@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.
|
@@ -28229,7 +28229,6 @@ func.UI.update_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
|
|
|
28229
28229
|
const _ds = func.utils.clean_returned_datasource(SESSION_ID, dsSessionP);
|
|
28230
28230
|
|
|
28231
28231
|
const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
|
|
28232
|
-
const data = _ds?.data_feed?.rows?.[row_idx] || {};
|
|
28233
28232
|
|
|
28234
28233
|
let SYS_GLOBAL_OBJ_REFS = _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'];
|
|
28235
28234
|
|
|
@@ -28237,12 +28236,12 @@ func.UI.update_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
|
|
|
28237
28236
|
SYS_GLOBAL_OBJ_REFS[ref_field_id] = {};
|
|
28238
28237
|
}
|
|
28239
28238
|
SYS_GLOBAL_OBJ_REFS[ref_field_id].ds = _ds;
|
|
28240
|
-
SYS_GLOBAL_OBJ_REFS[ref_field_id].data =
|
|
28239
|
+
SYS_GLOBAL_OBJ_REFS[ref_field_id].data = _ds?.data_feed?.rows?.[row_idx] || {};
|
|
28240
|
+
SYS_GLOBAL_OBJ_REFS[ref_field_id].props = _ds.in_parameters || {};
|
|
28241
28241
|
|
|
28242
28242
|
if ($elm) {
|
|
28243
|
-
|
|
28244
|
-
|
|
28245
|
-
|
|
28243
|
+
const attributes = $elm?.data()?.xuData?.properties || {};
|
|
28244
|
+
SYS_GLOBAL_OBJ_REFS[ref_field_id].attributes = attributes;
|
|
28246
28245
|
SYS_GLOBAL_OBJ_REFS[ref_field_id].xu_ui_id = $elm.attr('xu-ui-id');
|
|
28247
28246
|
}
|
|
28248
28247
|
};
|
|
@@ -31988,108 +31987,6 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
31988
31987
|
const common_fx = {
|
|
31989
31988
|
'xu-ref': async function ($elm, val) {
|
|
31990
31989
|
func.UI.update_xu_ref(SESSION_ID, paramsP.dsSessionP, val.value, $elm);
|
|
31991
|
-
// const _session = SESSION_OBJ[SESSION_ID];
|
|
31992
|
-
// let _ds_0 = _session.DS_GLB[0];
|
|
31993
|
-
|
|
31994
|
-
// const _ds = func.utils.clean_returned_datasource(SESSION_ID, paramsP.dsSessionP);
|
|
31995
|
-
|
|
31996
|
-
// const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
|
|
31997
|
-
// const data = _ds?.data_feed?.rows?.[row_idx] || {};
|
|
31998
|
-
|
|
31999
|
-
// const props = _ds.in_parameters || {};
|
|
32000
|
-
// const attributes = $elm?.data()?.xuData?.properties || {};
|
|
32001
|
-
// const xu_ui_id = $elm.attr('xu-ui-id');
|
|
32002
|
-
|
|
32003
|
-
// // _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'][val.value] = { $el: $elm, ds: _ds, data, attributes, props };
|
|
32004
|
-
// _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'][val.value] = { ds: _ds, data, attributes, props, xu_ui_id };
|
|
32005
|
-
|
|
32006
|
-
// const proxy1 = new Proxy(_session.DS_GLB[paramsP.dsSessionP], {
|
|
32007
|
-
// get(target, prop, receiver) {
|
|
32008
|
-
// debugger;
|
|
32009
|
-
// return 'world';
|
|
32010
|
-
// },
|
|
32011
|
-
// });
|
|
32012
|
-
|
|
32013
|
-
// Object.observe(_session.DS_GLB[paramsP.dsSessionP], function (changes) {
|
|
32014
|
-
// console.log(changes);
|
|
32015
|
-
// });
|
|
32016
|
-
|
|
32017
|
-
// create a new instance of `MutationObserver` named `observer`,
|
|
32018
|
-
// passing it a callback function
|
|
32019
|
-
// const observer = new MutationObserver(() => {
|
|
32020
|
-
// console.log('callback that runs when observer is triggered');
|
|
32021
|
-
// });
|
|
32022
|
-
|
|
32023
|
-
// // call `observe()`, passing it the element to observe, and the options object
|
|
32024
|
-
// observer.observe(_session.DS_GLB[paramsP.dsSessionP], {
|
|
32025
|
-
// subtree: true,
|
|
32026
|
-
// childList: true,
|
|
32027
|
-
// });
|
|
32028
|
-
//==================
|
|
32029
|
-
// class ObjectObserver {
|
|
32030
|
-
// constructor(targetObject, callback) {
|
|
32031
|
-
// this.callback = callback;
|
|
32032
|
-
// this.target = targetObject;
|
|
32033
|
-
|
|
32034
|
-
// // Create a proxy to intercept property access and modifications
|
|
32035
|
-
// this.proxy = new Proxy(targetObject, {
|
|
32036
|
-
// set: (target, property, value) => {
|
|
32037
|
-
// const oldValue = target[property];
|
|
32038
|
-
// target[property] = value;
|
|
32039
|
-
|
|
32040
|
-
// // Call the callback with mutation information
|
|
32041
|
-
// this.callback({
|
|
32042
|
-
// type: 'update',
|
|
32043
|
-
// object: target,
|
|
32044
|
-
// property,
|
|
32045
|
-
// oldValue,
|
|
32046
|
-
// newValue: value,
|
|
32047
|
-
// });
|
|
32048
|
-
|
|
32049
|
-
// return true;
|
|
32050
|
-
// },
|
|
32051
|
-
|
|
32052
|
-
// deleteProperty: (target, property) => {
|
|
32053
|
-
// const oldValue = target[property];
|
|
32054
|
-
// const deleted = delete target[property];
|
|
32055
|
-
|
|
32056
|
-
// if (deleted) {
|
|
32057
|
-
// this.callback({
|
|
32058
|
-
// type: 'delete',
|
|
32059
|
-
// object: target,
|
|
32060
|
-
// property,
|
|
32061
|
-
// oldValue,
|
|
32062
|
-
// });
|
|
32063
|
-
// }
|
|
32064
|
-
|
|
32065
|
-
// return deleted;
|
|
32066
|
-
// },
|
|
32067
|
-
// });
|
|
32068
|
-
|
|
32069
|
-
// return this.proxy;
|
|
32070
|
-
// }
|
|
32071
|
-
|
|
32072
|
-
// // Method to stop observing (for cleanup)
|
|
32073
|
-
// disconnect() {
|
|
32074
|
-
// this.callback = null;
|
|
32075
|
-
// this.target = null;
|
|
32076
|
-
// this.proxy = null;
|
|
32077
|
-
// }
|
|
32078
|
-
// }
|
|
32079
|
-
|
|
32080
|
-
// // Usage example:
|
|
32081
|
-
// const originalObject = _session.DS_GLB[paramsP.dsSessionP];
|
|
32082
|
-
|
|
32083
|
-
// // Create observer with callback
|
|
32084
|
-
// const observedObject = new ObjectObserver(originalObject, (mutation) => {
|
|
32085
|
-
// console.log('Change detected:', mutation);
|
|
32086
|
-
// });
|
|
32087
|
-
|
|
32088
|
-
// // These operations will trigger the callback
|
|
32089
|
-
// observedObject.name = "Jane"; // Property update
|
|
32090
|
-
// observedObject.job = "Developer"; // Property addition
|
|
32091
|
-
// delete observedObject.age; // Property deletion
|
|
32092
|
-
//==================
|
|
32093
31990
|
|
|
32094
31991
|
return {};
|
|
32095
31992
|
},
|