@xuda.io/runtime-bundle 1.0.399 → 1.0.400

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.
@@ -9050,7 +9050,6 @@ func.UI.update_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
9050
9050
  const _ds = func.utils.clean_returned_datasource(SESSION_ID, dsSessionP);
9051
9051
 
9052
9052
  const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
9053
- const data = _ds?.data_feed?.rows?.[row_idx] || {};
9054
9053
 
9055
9054
  let SYS_GLOBAL_OBJ_REFS = _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'];
9056
9055
 
@@ -9058,12 +9057,12 @@ func.UI.update_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
9058
9057
  SYS_GLOBAL_OBJ_REFS[ref_field_id] = {};
9059
9058
  }
9060
9059
  SYS_GLOBAL_OBJ_REFS[ref_field_id].ds = _ds;
9061
- SYS_GLOBAL_OBJ_REFS[ref_field_id].data = data;
9060
+ SYS_GLOBAL_OBJ_REFS[ref_field_id].data = _ds?.data_feed?.rows?.[row_idx] || {};
9061
+ SYS_GLOBAL_OBJ_REFS[ref_field_id].props = _ds.in_parameters || {};
9062
9062
 
9063
9063
  if ($elm) {
9064
- // const props = _ds.in_parameters || {};
9065
- // const attributes = $elm?.data()?.xuData?.properties || {};
9066
-
9064
+ const attributes = $elm?.data()?.xuData?.properties || {};
9065
+ SYS_GLOBAL_OBJ_REFS[ref_field_id].attributes = attributes;
9067
9066
  SYS_GLOBAL_OBJ_REFS[ref_field_id].xu_ui_id = $elm.attr('xu-ui-id');
9068
9067
  }
9069
9068
  };
@@ -11956,108 +11955,6 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
11956
11955
  const common_fx = {
11957
11956
  'xu-ref': async function ($elm, val) {
11958
11957
  func.UI.update_xu_ref(SESSION_ID, paramsP.dsSessionP, val.value, $elm);
11959
- // const _session = SESSION_OBJ[SESSION_ID];
11960
- // let _ds_0 = _session.DS_GLB[0];
11961
-
11962
- // const _ds = func.utils.clean_returned_datasource(SESSION_ID, paramsP.dsSessionP);
11963
-
11964
- // const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
11965
- // const data = _ds?.data_feed?.rows?.[row_idx] || {};
11966
-
11967
- // const props = _ds.in_parameters || {};
11968
- // const attributes = $elm?.data()?.xuData?.properties || {};
11969
- // const xu_ui_id = $elm.attr('xu-ui-id');
11970
-
11971
- // // _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'][val.value] = { $el: $elm, ds: _ds, data, attributes, props };
11972
- // _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'][val.value] = { ds: _ds, data, attributes, props, xu_ui_id };
11973
-
11974
- // const proxy1 = new Proxy(_session.DS_GLB[paramsP.dsSessionP], {
11975
- // get(target, prop, receiver) {
11976
- // debugger;
11977
- // return 'world';
11978
- // },
11979
- // });
11980
-
11981
- // Object.observe(_session.DS_GLB[paramsP.dsSessionP], function (changes) {
11982
- // console.log(changes);
11983
- // });
11984
-
11985
- // create a new instance of `MutationObserver` named `observer`,
11986
- // passing it a callback function
11987
- // const observer = new MutationObserver(() => {
11988
- // console.log('callback that runs when observer is triggered');
11989
- // });
11990
-
11991
- // // call `observe()`, passing it the element to observe, and the options object
11992
- // observer.observe(_session.DS_GLB[paramsP.dsSessionP], {
11993
- // subtree: true,
11994
- // childList: true,
11995
- // });
11996
- //==================
11997
- // class ObjectObserver {
11998
- // constructor(targetObject, callback) {
11999
- // this.callback = callback;
12000
- // this.target = targetObject;
12001
-
12002
- // // Create a proxy to intercept property access and modifications
12003
- // this.proxy = new Proxy(targetObject, {
12004
- // set: (target, property, value) => {
12005
- // const oldValue = target[property];
12006
- // target[property] = value;
12007
-
12008
- // // Call the callback with mutation information
12009
- // this.callback({
12010
- // type: 'update',
12011
- // object: target,
12012
- // property,
12013
- // oldValue,
12014
- // newValue: value,
12015
- // });
12016
-
12017
- // return true;
12018
- // },
12019
-
12020
- // deleteProperty: (target, property) => {
12021
- // const oldValue = target[property];
12022
- // const deleted = delete target[property];
12023
-
12024
- // if (deleted) {
12025
- // this.callback({
12026
- // type: 'delete',
12027
- // object: target,
12028
- // property,
12029
- // oldValue,
12030
- // });
12031
- // }
12032
-
12033
- // return deleted;
12034
- // },
12035
- // });
12036
-
12037
- // return this.proxy;
12038
- // }
12039
-
12040
- // // Method to stop observing (for cleanup)
12041
- // disconnect() {
12042
- // this.callback = null;
12043
- // this.target = null;
12044
- // this.proxy = null;
12045
- // }
12046
- // }
12047
-
12048
- // // Usage example:
12049
- // const originalObject = _session.DS_GLB[paramsP.dsSessionP];
12050
-
12051
- // // Create observer with callback
12052
- // const observedObject = new ObjectObserver(originalObject, (mutation) => {
12053
- // console.log('Change detected:', mutation);
12054
- // });
12055
-
12056
- // // These operations will trigger the callback
12057
- // observedObject.name = "Jane"; // Property update
12058
- // observedObject.job = "Developer"; // Property addition
12059
- // delete observedObject.age; // Property deletion
12060
- //==================
12061
11958
 
12062
11959
  return {};
12063
11960
  },
@@ -9051,7 +9051,6 @@ func.UI.update_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
9051
9051
  const _ds = func.utils.clean_returned_datasource(SESSION_ID, dsSessionP);
9052
9052
 
9053
9053
  const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
9054
- const data = _ds?.data_feed?.rows?.[row_idx] || {};
9055
9054
 
9056
9055
  let SYS_GLOBAL_OBJ_REFS = _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'];
9057
9056
 
@@ -9059,12 +9058,12 @@ func.UI.update_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
9059
9058
  SYS_GLOBAL_OBJ_REFS[ref_field_id] = {};
9060
9059
  }
9061
9060
  SYS_GLOBAL_OBJ_REFS[ref_field_id].ds = _ds;
9062
- SYS_GLOBAL_OBJ_REFS[ref_field_id].data = data;
9061
+ SYS_GLOBAL_OBJ_REFS[ref_field_id].data = _ds?.data_feed?.rows?.[row_idx] || {};
9062
+ SYS_GLOBAL_OBJ_REFS[ref_field_id].props = _ds.in_parameters || {};
9063
9063
 
9064
9064
  if ($elm) {
9065
- // const props = _ds.in_parameters || {};
9066
- // const attributes = $elm?.data()?.xuData?.properties || {};
9067
-
9065
+ const attributes = $elm?.data()?.xuData?.properties || {};
9066
+ SYS_GLOBAL_OBJ_REFS[ref_field_id].attributes = attributes;
9068
9067
  SYS_GLOBAL_OBJ_REFS[ref_field_id].xu_ui_id = $elm.attr('xu-ui-id');
9069
9068
  }
9070
9069
  };
@@ -10029,108 +10028,6 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
10029
10028
  const common_fx = {
10030
10029
  'xu-ref': async function ($elm, val) {
10031
10030
  func.UI.update_xu_ref(SESSION_ID, paramsP.dsSessionP, val.value, $elm);
10032
- // const _session = SESSION_OBJ[SESSION_ID];
10033
- // let _ds_0 = _session.DS_GLB[0];
10034
-
10035
- // const _ds = func.utils.clean_returned_datasource(SESSION_ID, paramsP.dsSessionP);
10036
-
10037
- // const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
10038
- // const data = _ds?.data_feed?.rows?.[row_idx] || {};
10039
-
10040
- // const props = _ds.in_parameters || {};
10041
- // const attributes = $elm?.data()?.xuData?.properties || {};
10042
- // const xu_ui_id = $elm.attr('xu-ui-id');
10043
-
10044
- // // _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'][val.value] = { $el: $elm, ds: _ds, data, attributes, props };
10045
- // _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'][val.value] = { ds: _ds, data, attributes, props, xu_ui_id };
10046
-
10047
- // const proxy1 = new Proxy(_session.DS_GLB[paramsP.dsSessionP], {
10048
- // get(target, prop, receiver) {
10049
- // debugger;
10050
- // return 'world';
10051
- // },
10052
- // });
10053
-
10054
- // Object.observe(_session.DS_GLB[paramsP.dsSessionP], function (changes) {
10055
- // console.log(changes);
10056
- // });
10057
-
10058
- // create a new instance of `MutationObserver` named `observer`,
10059
- // passing it a callback function
10060
- // const observer = new MutationObserver(() => {
10061
- // console.log('callback that runs when observer is triggered');
10062
- // });
10063
-
10064
- // // call `observe()`, passing it the element to observe, and the options object
10065
- // observer.observe(_session.DS_GLB[paramsP.dsSessionP], {
10066
- // subtree: true,
10067
- // childList: true,
10068
- // });
10069
- //==================
10070
- // class ObjectObserver {
10071
- // constructor(targetObject, callback) {
10072
- // this.callback = callback;
10073
- // this.target = targetObject;
10074
-
10075
- // // Create a proxy to intercept property access and modifications
10076
- // this.proxy = new Proxy(targetObject, {
10077
- // set: (target, property, value) => {
10078
- // const oldValue = target[property];
10079
- // target[property] = value;
10080
-
10081
- // // Call the callback with mutation information
10082
- // this.callback({
10083
- // type: 'update',
10084
- // object: target,
10085
- // property,
10086
- // oldValue,
10087
- // newValue: value,
10088
- // });
10089
-
10090
- // return true;
10091
- // },
10092
-
10093
- // deleteProperty: (target, property) => {
10094
- // const oldValue = target[property];
10095
- // const deleted = delete target[property];
10096
-
10097
- // if (deleted) {
10098
- // this.callback({
10099
- // type: 'delete',
10100
- // object: target,
10101
- // property,
10102
- // oldValue,
10103
- // });
10104
- // }
10105
-
10106
- // return deleted;
10107
- // },
10108
- // });
10109
-
10110
- // return this.proxy;
10111
- // }
10112
-
10113
- // // Method to stop observing (for cleanup)
10114
- // disconnect() {
10115
- // this.callback = null;
10116
- // this.target = null;
10117
- // this.proxy = null;
10118
- // }
10119
- // }
10120
-
10121
- // // Usage example:
10122
- // const originalObject = _session.DS_GLB[paramsP.dsSessionP];
10123
-
10124
- // // Create observer with callback
10125
- // const observedObject = new ObjectObserver(originalObject, (mutation) => {
10126
- // console.log('Change detected:', mutation);
10127
- // });
10128
-
10129
- // // These operations will trigger the callback
10130
- // observedObject.name = "Jane"; // Property update
10131
- // observedObject.job = "Developer"; // Property addition
10132
- // delete observedObject.age; // Property deletion
10133
- //==================
10134
10031
 
10135
10032
  return {};
10136
10033
  },