@xuda.io/runtime-bundle 1.0.518 → 1.0.520

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.
@@ -5056,201 +5056,201 @@ func.datasource.del = function (SESSION_ID, dsP) {
5056
5056
  }
5057
5057
  perform_delete();
5058
5058
  };
5059
- func.datasource.update_old = async function (SESSION_ID, datasource_changes, update_local_scope_only, avoid_refresh) {
5060
- return new Promise(async (resolve, reject) => {
5061
- var _session = SESSION_OBJ[SESSION_ID];
5062
-
5063
- if (_session.IS_API || typeof IS_MASTER_WEBSOCKET !== 'undefined' || typeof IS_PROCESS_SERVER !== 'undefined') {
5064
- update_local_scope_only = true;
5065
- }
5066
-
5067
- if (typeof glb.GLOBAL_VARS === 'undefined') {
5068
- glb.GLOBAL_VARS = (await func.common.get_module(SESSION_ID, 'xuda-system-globals-module.mjs')).system_globals;
5069
- }
5070
-
5071
- const set_fieldComputed_dependencies = async function (dsNo, field_id, parent_ds) {
5072
- // iterate child ds
5073
- for (const [dsSession, _ds] of Object.entries(_session.DS_GLB)) {
5074
- if (parent_ds !== null) {
5075
- if (_ds.parentDataSourceNo != parent_ds) continue;
5076
- } else {
5077
- if (dsSession != dsNo) continue;
5078
- }
5079
- let tree_ret = await func.utils.TREE_OBJ.get(SESSION_ID, _ds.prog_id);
5080
- if (tree_ret.menuType === 'component' || tree_ret.menuType === 'globals') {
5081
- // check if field has fieldComputed property
5082
- const _progFields = await func.datasource.get_progFields(SESSION_ID, dsSession);
5083
- // find if field is computed
5084
- let fieldComputed_propExpressions, fieldComputed_id;
5085
- for await (const val of _progFields) {
5086
- const fieldId = val.data.field_id;
5087
-
5088
- // if (fieldId !== field_id) continue
5089
- if (val.data.type !== 'virtual' || !val.props.fieldComputed) continue;
5059
+ // func.datasource.update_old = async function (SESSION_ID, datasource_changes, update_local_scope_only, avoid_refresh) {
5060
+ // return new Promise(async (resolve, reject) => {
5061
+ // var _session = SESSION_OBJ[SESSION_ID];
5090
5062
 
5091
- const _propExpressions = val.props?.propExpressions?.fieldValue;
5092
- if (_propExpressions && JSON.stringify(_propExpressions).includes(field_id)) {
5093
- fieldComputed_propExpressions = _propExpressions;
5094
- fieldComputed_id = fieldId;
5095
- }
5096
- }
5097
-
5098
- if (!fieldComputed_id) return;
5099
-
5100
- // iterate ds rows
5101
- for (const row of _ds.data_feed?.rows || []) {
5102
- // iterate row fields
5103
- for (const [key, val] of Object.entries(row)) {
5104
- if (key !== fieldComputed_id) continue;
5105
- try {
5106
- let ret = await func.expression.get(SESSION_ID, fieldComputed_propExpressions, dsNo, 'update', row._ROWID);
5107
-
5108
- const row_idx = func.common.find_ROWID_idx(_ds, row._ROWID);
5109
- if (_ds.data_feed.rows[row_idx][fieldComputed_id] !== ret.result) {
5110
- _ds.data_feed.rows[row_idx][fieldComputed_id] = ret.result;
5111
- if (!fields_changed.includes(fieldComputed_id)) {
5112
- fields_changed.push(fieldComputed_id);
5113
- }
5114
- if (!datasource_changed.includes(dsSession)) {
5115
- datasource_changed.push(dsSession);
5116
- }
5117
- }
5118
- } catch (err) {
5119
- console.error(err);
5120
- }
5121
- }
5122
- }
5123
- }
5124
- await set_fieldComputed_dependencies(dsNo, field_id, dsSession);
5125
- }
5126
- };
5127
-
5128
- var fields_changed = [];
5129
- var datasource_changed = [];
5130
- let client_datasource_changes = {};
5131
- let server_datasource_changes = {};
5132
- // iterate changes datasource
5133
- for await (const [dataSource, row_data] of Object.entries(datasource_changes)) {
5134
- var _ds = _session.DS_GLB[dataSource];
5135
- if (!_ds) {
5136
- continue;
5137
- }
5138
-
5139
- const update_xu_ref = async function () {
5140
- let _ds_0 = _session.DS_GLB[0];
5141
- for ([ref_name, val] of Object.entries(_ds_0.data_system['SYS_GLOBAL_OBJ_REFS'])) {
5142
- if (val.ds.dsSession == dataSource) {
5143
- func.UI.update_xu_ref(SESSION_ID, dataSource, ref_name);
5144
- }
5145
- }
5146
- };
5147
-
5148
- // iterate changes records
5149
- for (const [record_id, fields_data] of Object.entries(row_data)) {
5150
- // iterate changes fields
5151
- for (const [field_id, value] of Object.entries(fields_data)) {
5152
- // mechanism to make update directly on the datasource object
5153
- if (record_id === 'datasource_main') {
5154
- _.set(_ds, field_id, value);
5155
- update_xu_ref();
5156
- continue;
5157
- }
5158
-
5159
- if (typeof fields_data === 'object') {
5160
- if (glb.GLOBAL_VARS[field_id]) {
5161
- _ds.data_system[field_id] = value;
5162
- continue;
5163
- }
5063
+ // if (_session.IS_API || typeof IS_MASTER_WEBSOCKET !== 'undefined' || typeof IS_PROCESS_SERVER !== 'undefined') {
5064
+ // update_local_scope_only = true;
5065
+ // }
5164
5066
 
5165
- // try {
5166
- const row_idx = func.common.find_ROWID_idx(_ds, record_id);
5167
- if (_ds.data_feed.rows[row_idx][field_id] !== value) {
5168
- _ds.data_feed.rows[row_idx][field_id] = value;
5169
- await set_fieldComputed_dependencies(dataSource, field_id, null);
5067
+ // if (typeof glb.GLOBAL_VARS === 'undefined') {
5068
+ // glb.GLOBAL_VARS = (await func.common.get_module(SESSION_ID, 'xuda-system-globals-module.mjs')).system_globals;
5069
+ // }
5170
5070
 
5171
- // search the field in refs
5172
- update_xu_ref();
5071
+ // const set_fieldComputed_dependencies = async function (dsNo, field_id, parent_ds) {
5072
+ // // iterate child ds
5073
+ // for (const [dsSession, _ds] of Object.entries(_session.DS_GLB)) {
5074
+ // if (parent_ds !== null) {
5075
+ // if (_ds.parentDataSourceNo != parent_ds) continue;
5076
+ // } else {
5077
+ // if (dsSession != dsNo) continue;
5078
+ // }
5079
+ // let tree_ret = await func.utils.TREE_OBJ.get(SESSION_ID, _ds.prog_id);
5080
+ // if (tree_ret.menuType === 'component' || tree_ret.menuType === 'globals') {
5081
+ // // check if field has fieldComputed property
5082
+ // const _progFields = await func.datasource.get_progFields(SESSION_ID, dsSession);
5083
+ // // find if field is computed
5084
+ // let fieldComputed_propExpressions, fieldComputed_id;
5085
+ // for await (const val of _progFields) {
5086
+ // const fieldId = val.data.field_id;
5087
+
5088
+ // // if (fieldId !== field_id) continue
5089
+ // if (val.data.type !== 'virtual' || !val.props.fieldComputed) continue;
5090
+
5091
+ // const _propExpressions = val.props?.propExpressions?.fieldValue;
5092
+ // if (_propExpressions && JSON.stringify(_propExpressions).includes(field_id)) {
5093
+ // fieldComputed_propExpressions = _propExpressions;
5094
+ // fieldComputed_id = fieldId;
5095
+ // }
5096
+ // }
5173
5097
 
5174
- if (!update_local_scope_only) {
5175
- let tree_ret = await func.utils.TREE_OBJ.get(SESSION_ID, _ds.prog_id);
5176
- if (glb.IS_WORKER) {
5177
- // RUN AT SERVER
5178
- if (tree_ret.menuType === 'globals' || tree_ret.menuType === 'component') {
5179
- const _progFields = await func.datasource.get_progFields(SESSION_ID, dataSource);
5180
- let view_field_obj = func.common.find_item_by_key(_progFields, 'field_id', field_id);
5181
- if (!view_field_obj?.data?.serverField && record_id !== 'data_system') {
5182
- if (!client_datasource_changes[dataSource]) {
5183
- client_datasource_changes[dataSource] = {};
5184
- }
5185
- if (!client_datasource_changes[dataSource][record_id]) {
5186
- client_datasource_changes[dataSource][record_id] = {};
5187
- }
5188
- client_datasource_changes[dataSource][record_id][field_id] = value;
5189
- }
5190
- }
5191
- } else {
5192
- // RUN AT CLIENT
5193
- if ((tree_ret.menuType === 'component' && _ds._run_at !== 'client') || tree_ret.menuType === 'globals') {
5194
- if (!server_datasource_changes[dataSource]) {
5195
- server_datasource_changes[dataSource] = {};
5196
- }
5197
- if (!server_datasource_changes[dataSource][record_id]) {
5198
- server_datasource_changes[dataSource][record_id] = {};
5199
- }
5200
- server_datasource_changes[dataSource][record_id][field_id] = value;
5201
- }
5202
- }
5203
- }
5098
+ // if (!fieldComputed_id) return;
5099
+
5100
+ // // iterate ds rows
5101
+ // for (const row of _ds.data_feed?.rows || []) {
5102
+ // // iterate row fields
5103
+ // for (const [key, val] of Object.entries(row)) {
5104
+ // if (key !== fieldComputed_id) continue;
5105
+ // try {
5106
+ // let ret = await func.expression.get(SESSION_ID, fieldComputed_propExpressions, dsNo, 'update', row._ROWID);
5107
+
5108
+ // const row_idx = func.common.find_ROWID_idx(_ds, row._ROWID);
5109
+ // if (_ds.data_feed.rows[row_idx][fieldComputed_id] !== ret.result) {
5110
+ // _ds.data_feed.rows[row_idx][fieldComputed_id] = ret.result;
5111
+ // if (!fields_changed.includes(fieldComputed_id)) {
5112
+ // fields_changed.push(fieldComputed_id);
5113
+ // }
5114
+ // if (!datasource_changed.includes(dsSession)) {
5115
+ // datasource_changed.push(dsSession);
5116
+ // }
5117
+ // }
5118
+ // } catch (err) {
5119
+ // console.error(err);
5120
+ // }
5121
+ // }
5122
+ // }
5123
+ // }
5124
+ // await set_fieldComputed_dependencies(dsNo, field_id, dsSession);
5125
+ // }
5126
+ // };
5127
+
5128
+ // var fields_changed = [];
5129
+ // var datasource_changed = [];
5130
+ // let client_datasource_changes = {};
5131
+ // let server_datasource_changes = {};
5132
+ // // iterate changes datasource
5133
+ // for await (const [dataSource, row_data] of Object.entries(datasource_changes)) {
5134
+ // var _ds = _session.DS_GLB[dataSource];
5135
+ // if (!_ds) {
5136
+ // continue;
5137
+ // }
5204
5138
 
5205
- if (!fields_changed.includes(field_id)) {
5206
- fields_changed.push(field_id);
5207
- }
5208
- if (!datasource_changed.includes(dataSource)) {
5209
- datasource_changed.push(dataSource);
5210
- }
5139
+ // const update_xu_ref = async function () {
5140
+ // let _ds_0 = _session.DS_GLB[0];
5141
+ // for ([ref_name, val] of Object.entries(_ds_0.data_system['SYS_GLOBAL_OBJ_REFS'])) {
5142
+ // if (val.ds.dsSession == dataSource) {
5143
+ // func.UI.update_xu_ref(SESSION_ID, dataSource, ref_name);
5144
+ // }
5145
+ // }
5146
+ // };
5147
+
5148
+ // // iterate changes records
5149
+ // for (const [record_id, fields_data] of Object.entries(row_data)) {
5150
+ // // iterate changes fields
5151
+ // for (const [field_id, value] of Object.entries(fields_data)) {
5152
+ // // mechanism to make update directly on the datasource object
5153
+ // if (record_id === 'datasource_main') {
5154
+ // _.set(_ds, field_id, value);
5155
+ // update_xu_ref();
5156
+ // continue;
5157
+ // }
5211
5158
 
5212
- if (!_ds.data_feed.rows_changed) {
5213
- _ds.data_feed.rows_changed = [];
5214
- }
5215
- if (!_ds.data_feed.rows_changed.includes(record_id)) _ds.data_feed.rows_changed.push(record_id);
5216
- }
5217
- } else if (fields_data === 'set') {
5218
- _ds.currentRecordId = record_id;
5219
- }
5220
- }
5221
- }
5222
- }
5159
+ // if (typeof fields_data === 'object') {
5160
+ // if (glb.GLOBAL_VARS[field_id]) {
5161
+ // _ds.data_system[field_id] = value;
5162
+ // continue;
5163
+ // }
5164
+
5165
+ // // try {
5166
+ // const row_idx = func.common.find_ROWID_idx(_ds, record_id);
5167
+ // if (_ds.data_feed.rows[row_idx][field_id] !== value) {
5168
+ // _ds.data_feed.rows[row_idx][field_id] = value;
5169
+ // await set_fieldComputed_dependencies(dataSource, field_id, null);
5170
+
5171
+ // // search the field in refs
5172
+ // update_xu_ref();
5173
+
5174
+ // if (!update_local_scope_only) {
5175
+ // let tree_ret = await func.utils.TREE_OBJ.get(SESSION_ID, _ds.prog_id);
5176
+ // if (glb.IS_WORKER) {
5177
+ // // RUN AT SERVER
5178
+ // if (tree_ret.menuType === 'globals' || tree_ret.menuType === 'component') {
5179
+ // const _progFields = await func.datasource.get_progFields(SESSION_ID, dataSource);
5180
+ // let view_field_obj = func.common.find_item_by_key(_progFields, 'field_id', field_id);
5181
+ // if (!view_field_obj?.data?.serverField && record_id !== 'data_system') {
5182
+ // if (!client_datasource_changes[dataSource]) {
5183
+ // client_datasource_changes[dataSource] = {};
5184
+ // }
5185
+ // if (!client_datasource_changes[dataSource][record_id]) {
5186
+ // client_datasource_changes[dataSource][record_id] = {};
5187
+ // }
5188
+ // client_datasource_changes[dataSource][record_id][field_id] = value;
5189
+ // }
5190
+ // }
5191
+ // } else {
5192
+ // // RUN AT CLIENT
5193
+ // if ((tree_ret.menuType === 'component' && _ds._run_at !== 'client') || tree_ret.menuType === 'globals') {
5194
+ // if (!server_datasource_changes[dataSource]) {
5195
+ // server_datasource_changes[dataSource] = {};
5196
+ // }
5197
+ // if (!server_datasource_changes[dataSource][record_id]) {
5198
+ // server_datasource_changes[dataSource][record_id] = {};
5199
+ // }
5200
+ // server_datasource_changes[dataSource][record_id][field_id] = value;
5201
+ // }
5202
+ // }
5203
+ // }
5204
+
5205
+ // if (!fields_changed.includes(field_id)) {
5206
+ // fields_changed.push(field_id);
5207
+ // }
5208
+ // if (!datasource_changed.includes(dataSource)) {
5209
+ // datasource_changed.push(dataSource);
5210
+ // }
5211
+
5212
+ // if (!_ds.data_feed.rows_changed) {
5213
+ // _ds.data_feed.rows_changed = [];
5214
+ // }
5215
+ // if (!_ds.data_feed.rows_changed.includes(record_id)) _ds.data_feed.rows_changed.push(record_id);
5216
+ // }
5217
+ // } else if (fields_data === 'set') {
5218
+ // _ds.currentRecordId = record_id;
5219
+ // }
5220
+ // }
5221
+ // }
5222
+ // }
5223
5223
 
5224
- if (glb.IS_WORKER) {
5225
- if (!update_local_scope_only && !_.isEmpty(client_datasource_changes)) {
5226
- func.utils.post_back_to_client(SESSION_ID, 'update_client_eventChangesResults_from_worker', _session.worker_id, client_datasource_changes);
5227
- }
5228
- } else {
5229
- if (!update_local_scope_only && !_.isEmpty(server_datasource_changes)) {
5230
- const ret = await func.index.call_worker(SESSION_ID, {
5231
- service: 'update_datasource_changes_from_client',
5232
- data: {
5233
- session_id: SESSION_ID,
5234
- datasource_changes: server_datasource_changes,
5235
- },
5236
- id: _ds.worker_id,
5237
- });
5238
- }
5239
- ///// REFRESH SCREEN
5240
- if (!avoid_refresh && fields_changed.length) {
5241
- await func.UI.screen.refresh_xu_attributes(SESSION_ID, fields_changed);
5242
- // await removed from the below function cause to dead lock Mar 3 25
5243
- func.UI.screen.refresh_screen(
5244
- SESSION_ID,
5245
- fields_changed,
5246
- null,
5247
- datasource_changed[0], // refresh the current datasource only
5248
- );
5249
- }
5250
- }
5251
- resolve();
5252
- });
5253
- };
5224
+ // if (glb.IS_WORKER) {
5225
+ // if (!update_local_scope_only && !_.isEmpty(client_datasource_changes)) {
5226
+ // func.utils.post_back_to_client(SESSION_ID, 'update_client_eventChangesResults_from_worker', _session.worker_id, client_datasource_changes);
5227
+ // }
5228
+ // } else {
5229
+ // if (!update_local_scope_only && !_.isEmpty(server_datasource_changes)) {
5230
+ // const ret = await func.index.call_worker(SESSION_ID, {
5231
+ // service: 'update_datasource_changes_from_client',
5232
+ // data: {
5233
+ // session_id: SESSION_ID,
5234
+ // datasource_changes: server_datasource_changes,
5235
+ // },
5236
+ // id: _ds.worker_id,
5237
+ // });
5238
+ // }
5239
+ // ///// REFRESH SCREEN
5240
+ // if (!avoid_refresh && fields_changed.length) {
5241
+ // await func.UI.screen.refresh_xu_attributes(SESSION_ID, fields_changed);
5242
+ // // await removed from the below function cause to dead lock Mar 3 25
5243
+ // func.UI.screen.refresh_screen(
5244
+ // SESSION_ID,
5245
+ // fields_changed,
5246
+ // null,
5247
+ // datasource_changed[0], // refresh the current datasource only
5248
+ // );
5249
+ // }
5250
+ // }
5251
+ // resolve();
5252
+ // });
5253
+ // };
5254
5254
 
5255
5255
  func.datasource.update = async function (SESSION_ID, datasource_changes, update_local_scope_only, avoid_refresh) {
5256
5256
  return new Promise(async (resolve, reject) => {
@@ -5325,6 +5325,18 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
5325
5325
  var datasource_changed = [];
5326
5326
  let client_datasource_changes = {};
5327
5327
  let server_datasource_changes = {};
5328
+
5329
+ const update_xu_ref = async function (dataSource, field_id) {
5330
+ let ret;
5331
+ let _ds_0 = _session.DS_GLB[0];
5332
+ for ([ref_name, val] of Object.entries(_ds_0.data_system['SYS_GLOBAL_OBJ_REFS'])) {
5333
+ if (val.ds.dsSession == dataSource) {
5334
+ ret = func.UI.update_xu_ref(SESSION_ID, dataSource, ref_name);
5335
+ }
5336
+ }
5337
+ return ret;
5338
+ };
5339
+
5328
5340
  // iterate changes datasource
5329
5341
  for await (const [dataSource, row_data] of Object.entries(datasource_changes)) {
5330
5342
  var _ds = _session.DS_GLB[dataSource];
@@ -5332,15 +5344,6 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
5332
5344
  continue;
5333
5345
  }
5334
5346
 
5335
- const update_xu_ref = async function () {
5336
- let _ds_0 = _session.DS_GLB[0];
5337
- for ([ref_name, val] of Object.entries(_ds_0.data_system['SYS_GLOBAL_OBJ_REFS'])) {
5338
- if (val.ds.dsSession == dataSource) {
5339
- func.UI.update_xu_ref(SESSION_ID, dataSource, ref_name);
5340
- }
5341
- }
5342
- };
5343
-
5344
5347
  // iterate changes records
5345
5348
  for (const [record_id, fields_data] of Object.entries(row_data)) {
5346
5349
  // iterate changes fields
@@ -5348,9 +5351,11 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
5348
5351
  // mechanism to make update directly on the datasource object
5349
5352
  if (record_id === 'datasource_main') {
5350
5353
  _.set(_ds, field_id, value);
5351
- update_xu_ref();
5352
- fields_changed.push(field_id);
5353
- datasource_changed.push(dataSource);
5354
+ const ret = update_xu_ref(dataSource, field_id);
5355
+ if (ret) {
5356
+ fields_changed.push(field_id);
5357
+ datasource_changed.push(dataSource);
5358
+ }
5354
5359
  continue;
5355
5360
  }
5356
5361
 
@@ -5367,7 +5372,7 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
5367
5372
  await set_fieldComputed_dependencies(dataSource, field_id, null);
5368
5373
 
5369
5374
  // search the field in refs
5370
- update_xu_ref();
5375
+ update_xu_ref(dataSource, field_id);
5371
5376
 
5372
5377
  if (!update_local_scope_only) {
5373
5378
  let tree_ret = await func.utils.TREE_OBJ.get(SESSION_ID, _ds.prog_id);
@@ -9311,6 +9316,7 @@ func.UI.refs_garbage_collector = function (SESSION_ID = Object.keys(SESSION_OBJ)
9311
9316
  };
9312
9317
 
9313
9318
  func.UI.update_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
9319
+ let ret;
9314
9320
  const _session = SESSION_OBJ[SESSION_ID];
9315
9321
  let _ds_0 = _session.DS_GLB[0];
9316
9322
 
@@ -9320,27 +9326,35 @@ func.UI.update_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
9320
9326
 
9321
9327
  let SYS_GLOBAL_OBJ_REFS = _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'];
9322
9328
 
9323
- if (!SYS_GLOBAL_OBJ_REFS[ref_field_id]) {
9324
- SYS_GLOBAL_OBJ_REFS[ref_field_id] = {};
9325
- }
9326
- SYS_GLOBAL_OBJ_REFS[ref_field_id].ds = _ds;
9327
- SYS_GLOBAL_OBJ_REFS[ref_field_id].data = _ds?.data_feed?.rows?.[row_idx] || {};
9328
- SYS_GLOBAL_OBJ_REFS[ref_field_id].props = _ds.in_parameters || {};
9329
-
9330
- if ($elm) {
9331
- const attributes = $elm?.data()?.xuData?.xuPanelProps || $elm?.data()?.xuData?.debug_info?.attribute_stat || {};
9332
- SYS_GLOBAL_OBJ_REFS[ref_field_id].attributes = attributes;
9333
- SYS_GLOBAL_OBJ_REFS[ref_field_id].xu_ui_id = $elm.attr('xu-ui-id');
9334
- }
9335
-
9336
- // let obj = { ds: _ds, data: _ds?.data_feed?.rows?.[row_idx] || {}, props: _ds.in_parameters || {} };
9329
+ // if (!SYS_GLOBAL_OBJ_REFS[ref_field_id]) {
9330
+ // SYS_GLOBAL_OBJ_REFS[ref_field_id] = {};
9331
+ // }
9332
+ // SYS_GLOBAL_OBJ_REFS[ref_field_id].ds = _ds;
9333
+ // SYS_GLOBAL_OBJ_REFS[ref_field_id].data = _ds?.data_feed?.rows?.[row_idx] || {};
9334
+ // SYS_GLOBAL_OBJ_REFS[ref_field_id].props = _ds.in_parameters || {};
9337
9335
 
9338
9336
  // if ($elm) {
9339
9337
  // const attributes = $elm?.data()?.xuData?.xuPanelProps || $elm?.data()?.xuData?.debug_info?.attribute_stat || {};
9340
- // obj.attributes = attributes;
9341
- // obj.xu_ui_id = $elm.attr('xu-ui-id');
9338
+ // SYS_GLOBAL_OBJ_REFS[ref_field_id].attributes = attributes;
9339
+ // SYS_GLOBAL_OBJ_REFS[ref_field_id].xu_ui_id = $elm.attr('xu-ui-id');
9342
9340
  // }
9343
9341
 
9342
+ let obj = { ds: _ds, data: _ds?.data_feed?.rows?.[row_idx] || {}, props: _ds.in_parameters || {} };
9343
+
9344
+ if ($elm) {
9345
+ const attributes = $elm?.data()?.xuData?.xuPanelProps || $elm?.data()?.xuData?.debug_info?.attribute_stat || {};
9346
+ obj.attributes = attributes;
9347
+ obj.xu_ui_id = $elm.attr('xu-ui-id');
9348
+ }
9349
+
9350
+ if (!_.isEqual(SYS_GLOBAL_OBJ_REFS?.[ref_field_id] || {}, obj)) {
9351
+ if (!SYS_GLOBAL_OBJ_REFS[ref_field_id]) {
9352
+ SYS_GLOBAL_OBJ_REFS[ref_field_id] = {};
9353
+ }
9354
+ SYS_GLOBAL_OBJ_REFS[ref_field_id] = obj;
9355
+ ret = true;
9356
+ }
9357
+ return ret;
9344
9358
  // func.datasource.update(SESSION_ID, {
9345
9359
  // [0]: {
9346
9360
  // ['datasource_main']: {