@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.
@@ -5184,10 +5184,6 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
5184
5184
  }
5185
5185
  }
5186
5186
 
5187
- // } catch (err) {
5188
- // console.error(err);
5189
- // }
5190
-
5191
5187
  if (!fields_changed.includes(field_id)) {
5192
5188
  fields_changed.push(field_id);
5193
5189
  }
@@ -5726,6 +5722,7 @@ func.datasource.reset_jobs = function (SESSION_ID, dsSessionP, sourceP, errP) {
5726
5722
  // _ds_0.data_system[val] = await func.utils.get_dateTime(SESSION_ID, val, ts);
5727
5723
  // }
5728
5724
  // };
5725
+
5729
5726
  func.datasource.get_currentRecordId = function (SESSION_ID, dsSessionP, from_datasourceP) {
5730
5727
  var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[dsSessionP];
5731
5728
  if (_ds._dataSourceTableId !== '') {
@@ -11956,6 +11953,31 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
11956
11953
  'xu-ref': async function ($elm, val) {
11957
11954
  func.UI.update_xu_ref(SESSION_ID, paramsP.dsSessionP, val.value, $elm);
11958
11955
 
11956
+ // Select the node that will be observed for mutations
11957
+ const targetNode = $elm[0];
11958
+
11959
+ // Options for the observer (which mutations to observe)
11960
+ const config = { attributes: true, childList: true, subtree: true };
11961
+
11962
+ // Callback function to execute when mutations are observed
11963
+ const callback = (mutationList, observer) => {
11964
+ func.UI.screen.refresh_xu_attributes(SESSION_ID, [val.value]);
11965
+ return;
11966
+ for (const mutation of mutationList) {
11967
+ if (mutation.type === 'childList') {
11968
+ console.log('A child node has been added or removed.');
11969
+ } else if (mutation.type === 'attributes') {
11970
+ console.log(`The ${mutation.attributeName} attribute was modified.`);
11971
+ }
11972
+ }
11973
+ };
11974
+
11975
+ // Create an observer instance linked to the callback function
11976
+ const observer = new MutationObserver(callback);
11977
+
11978
+ // Start observing the target node for configured mutations
11979
+ observer.observe(targetNode, config);
11980
+
11959
11981
  return {};
11960
11982
  },
11961
11983
  'xu-bind': async function ($elm, val) {
@@ -5185,10 +5185,6 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
5185
5185
  }
5186
5186
  }
5187
5187
 
5188
- // } catch (err) {
5189
- // console.error(err);
5190
- // }
5191
-
5192
5188
  if (!fields_changed.includes(field_id)) {
5193
5189
  fields_changed.push(field_id);
5194
5190
  }
@@ -5727,6 +5723,7 @@ func.datasource.reset_jobs = function (SESSION_ID, dsSessionP, sourceP, errP) {
5727
5723
  // _ds_0.data_system[val] = await func.utils.get_dateTime(SESSION_ID, val, ts);
5728
5724
  // }
5729
5725
  // };
5726
+
5730
5727
  func.datasource.get_currentRecordId = function (SESSION_ID, dsSessionP, from_datasourceP) {
5731
5728
  var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[dsSessionP];
5732
5729
  if (_ds._dataSourceTableId !== '') {
@@ -10029,6 +10026,31 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
10029
10026
  'xu-ref': async function ($elm, val) {
10030
10027
  func.UI.update_xu_ref(SESSION_ID, paramsP.dsSessionP, val.value, $elm);
10031
10028
 
10029
+ // Select the node that will be observed for mutations
10030
+ const targetNode = $elm[0];
10031
+
10032
+ // Options for the observer (which mutations to observe)
10033
+ const config = { attributes: true, childList: true, subtree: true };
10034
+
10035
+ // Callback function to execute when mutations are observed
10036
+ const callback = (mutationList, observer) => {
10037
+ func.UI.screen.refresh_xu_attributes(SESSION_ID, [val.value]);
10038
+ return;
10039
+ for (const mutation of mutationList) {
10040
+ if (mutation.type === 'childList') {
10041
+ console.log('A child node has been added or removed.');
10042
+ } else if (mutation.type === 'attributes') {
10043
+ console.log(`The ${mutation.attributeName} attribute was modified.`);
10044
+ }
10045
+ }
10046
+ };
10047
+
10048
+ // Create an observer instance linked to the callback function
10049
+ const observer = new MutationObserver(callback);
10050
+
10051
+ // Start observing the target node for configured mutations
10052
+ observer.observe(targetNode, config);
10053
+
10032
10054
  return {};
10033
10055
  },
10034
10056
  'xu-bind': async function ($elm, val) {