@xuda.io/runtime-bundle 1.0.402 → 1.0.404

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.
@@ -30185,10 +30185,6 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
30185
30185
  }
30186
30186
  }
30187
30187
 
30188
- // } catch (err) {
30189
- // console.error(err);
30190
- // }
30191
-
30192
30188
  if (!fields_changed.includes(field_id)) {
30193
30189
  fields_changed.push(field_id);
30194
30190
  }
@@ -30727,6 +30723,7 @@ func.datasource.reset_jobs = function (SESSION_ID, dsSessionP, sourceP, errP) {
30727
30723
  // _ds_0.data_system[val] = await func.utils.get_dateTime(SESSION_ID, val, ts);
30728
30724
  // }
30729
30725
  // };
30726
+
30730
30727
  func.datasource.get_currentRecordId = function (SESSION_ID, dsSessionP, from_datasourceP) {
30731
30728
  var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[dsSessionP];
30732
30729
  if (_ds._dataSourceTableId !== '') {
@@ -31988,6 +31985,31 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
31988
31985
  'xu-ref': async function ($elm, val) {
31989
31986
  func.UI.update_xu_ref(SESSION_ID, paramsP.dsSessionP, val.value, $elm);
31990
31987
 
31988
+ // Select the node that will be observed for mutations
31989
+ const targetNode = $elm[0];
31990
+
31991
+ // Options for the observer (which mutations to observe)
31992
+ const config = { attributes: true, childList: true, subtree: true };
31993
+
31994
+ // Callback function to execute when mutations are observed
31995
+ const callback = (mutationList, observer) => {
31996
+ func.UI.screen.refresh_xu_attributes(SESSION_ID, [val.value]);
31997
+ return;
31998
+ for (const mutation of mutationList) {
31999
+ if (mutation.type === 'childList') {
32000
+ console.log('A child node has been added or removed.');
32001
+ } else if (mutation.type === 'attributes') {
32002
+ console.log(`The ${mutation.attributeName} attribute was modified.`);
32003
+ }
32004
+ }
32005
+ };
32006
+
32007
+ // Create an observer instance linked to the callback function
32008
+ const observer = new MutationObserver(callback);
32009
+
32010
+ // Start observing the target node for configured mutations
32011
+ observer.observe(targetNode, config);
32012
+
31991
32013
  return {};
31992
32014
  },
31993
32015
  'xu-bind': async function ($elm, val) {