@xuda.io/runtime-bundle 1.0.389 → 1.0.390
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.
- package/js/xuda-runtime-bundle.js +92 -74
- package/js/xuda-runtime-bundle.min.js +1 -1
- package/js/xuda-runtime-slim.js +92 -74
- package/js/xuda-runtime-slim.min.es.js +92 -74
- package/js/xuda-runtime-slim.min.js +1 -1
- package/js/xuda-server-bundle.min.mjs +1 -1
- package/js/xuda-server-bundle.mjs +10 -9
- package/js/xuda-worker-bundle.js +10 -9
- package/js/xuda-worker-bundle.min.js +1 -1
- package/package.json +1 -1
|
@@ -28221,6 +28221,22 @@ func.UI.refs_garbage_collector = function (SESSION_ID = Object.keys(SESSION_OBJ)
|
|
|
28221
28221
|
}
|
|
28222
28222
|
}
|
|
28223
28223
|
};
|
|
28224
|
+
|
|
28225
|
+
func.UI.update_xu_ref = function (SESSION_ID, dsSessionP) {
|
|
28226
|
+
const _session = SESSION_OBJ[SESSION_ID];
|
|
28227
|
+
let _ds_0 = _session.DS_GLB[0];
|
|
28228
|
+
|
|
28229
|
+
const _ds = func.utils.clean_returned_datasource(SESSION_ID, dsSessionP);
|
|
28230
|
+
|
|
28231
|
+
const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
|
|
28232
|
+
const data = _ds?.data_feed?.rows?.[row_idx] || {};
|
|
28233
|
+
|
|
28234
|
+
const props = _ds.in_parameters || {};
|
|
28235
|
+
const attributes = $elm?.data()?.xuData?.properties || {};
|
|
28236
|
+
const xu_ui_id = $elm.attr('xu-ui-id');
|
|
28237
|
+
|
|
28238
|
+
_ds_0.data_system['SYS_GLOBAL_OBJ_REFS'][val.value] = { ds: _ds, data, attributes, props, xu_ui_id };
|
|
28239
|
+
};
|
|
28224
28240
|
func.datasource = {};
|
|
28225
28241
|
func.datasource.create = async function (
|
|
28226
28242
|
SESSION_ID,
|
|
@@ -30119,15 +30135,16 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
|
|
|
30119
30135
|
_ds.data_feed.rows[row_idx][field_id] = value;
|
|
30120
30136
|
await set_fieldComputed_dependencies(dataSource, field_id, null);
|
|
30121
30137
|
|
|
30122
|
-
//
|
|
30123
|
-
|
|
30124
|
-
|
|
30125
|
-
|
|
30126
|
-
|
|
30127
|
-
|
|
30128
|
-
|
|
30129
|
-
|
|
30130
|
-
|
|
30138
|
+
// search the field in refs
|
|
30139
|
+
let _ds_0 = _session.DS_GLB[0];
|
|
30140
|
+
for ([ref_name, val] of Object.entries(_ds_0.data_system['SYS_GLOBAL_OBJ_REFS'])) {
|
|
30141
|
+
if (val.ds.dsSession == dataSource) {
|
|
30142
|
+
func.UI.update_xu_ref(SESSION_ID, dataSource);
|
|
30143
|
+
// if (!fields_changed.includes(ref_name)) {
|
|
30144
|
+
// fields_changed.push(ref_name);
|
|
30145
|
+
// }
|
|
30146
|
+
}
|
|
30147
|
+
}
|
|
30131
30148
|
|
|
30132
30149
|
if (!update_local_scope_only) {
|
|
30133
30150
|
let tree_ret = await func.utils.TREE_OBJ.get(SESSION_ID, _ds.prog_id);
|
|
@@ -31961,20 +31978,21 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
31961
31978
|
|
|
31962
31979
|
const common_fx = {
|
|
31963
31980
|
'xu-ref': async function ($elm, val) {
|
|
31964
|
-
|
|
31965
|
-
|
|
31981
|
+
func.UI.update_xu_ref(SESSION_ID, paramsP.dsSessionP);
|
|
31982
|
+
// const _session = SESSION_OBJ[SESSION_ID];
|
|
31983
|
+
// let _ds_0 = _session.DS_GLB[0];
|
|
31966
31984
|
|
|
31967
|
-
const _ds = func.utils.clean_returned_datasource(SESSION_ID, paramsP.dsSessionP);
|
|
31985
|
+
// const _ds = func.utils.clean_returned_datasource(SESSION_ID, paramsP.dsSessionP);
|
|
31968
31986
|
|
|
31969
|
-
const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
|
|
31970
|
-
const data = _ds?.data_feed?.rows?.[row_idx] || {};
|
|
31987
|
+
// const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
|
|
31988
|
+
// const data = _ds?.data_feed?.rows?.[row_idx] || {};
|
|
31971
31989
|
|
|
31972
|
-
const props = _ds.in_parameters || {};
|
|
31973
|
-
const attributes = $elm?.data()?.xuData?.properties || {};
|
|
31974
|
-
const xu_ui_id = $elm.attr('xu-ui-id');
|
|
31990
|
+
// const props = _ds.in_parameters || {};
|
|
31991
|
+
// const attributes = $elm?.data()?.xuData?.properties || {};
|
|
31992
|
+
// const xu_ui_id = $elm.attr('xu-ui-id');
|
|
31975
31993
|
|
|
31976
|
-
// _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'][val.value] = { $el: $elm, ds: _ds, data, attributes, props };
|
|
31977
|
-
_ds_0.data_system['SYS_GLOBAL_OBJ_REFS'][val.value] = { ds: _ds, data, attributes, props, xu_ui_id };
|
|
31994
|
+
// // _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'][val.value] = { $el: $elm, ds: _ds, data, attributes, props };
|
|
31995
|
+
// _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'][val.value] = { ds: _ds, data, attributes, props, xu_ui_id };
|
|
31978
31996
|
|
|
31979
31997
|
// const proxy1 = new Proxy(_session.DS_GLB[paramsP.dsSessionP], {
|
|
31980
31998
|
// get(target, prop, receiver) {
|
|
@@ -31999,64 +32017,64 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
31999
32017
|
// childList: true,
|
|
32000
32018
|
// });
|
|
32001
32019
|
//==================
|
|
32002
|
-
class ObjectObserver {
|
|
32003
|
-
|
|
32004
|
-
|
|
32005
|
-
|
|
32006
|
-
|
|
32007
|
-
|
|
32008
|
-
|
|
32009
|
-
|
|
32010
|
-
|
|
32011
|
-
|
|
32012
|
-
|
|
32013
|
-
|
|
32014
|
-
|
|
32015
|
-
|
|
32016
|
-
|
|
32017
|
-
|
|
32018
|
-
|
|
32019
|
-
|
|
32020
|
-
|
|
32021
|
-
|
|
32022
|
-
|
|
32023
|
-
|
|
32024
|
-
|
|
32025
|
-
|
|
32026
|
-
|
|
32027
|
-
|
|
32028
|
-
|
|
32029
|
-
|
|
32030
|
-
|
|
32031
|
-
|
|
32032
|
-
|
|
32033
|
-
|
|
32034
|
-
|
|
32035
|
-
|
|
32036
|
-
|
|
32037
|
-
|
|
32038
|
-
|
|
32039
|
-
|
|
32040
|
-
|
|
32041
|
-
|
|
32042
|
-
|
|
32043
|
-
|
|
32020
|
+
// class ObjectObserver {
|
|
32021
|
+
// constructor(targetObject, callback) {
|
|
32022
|
+
// this.callback = callback;
|
|
32023
|
+
// this.target = targetObject;
|
|
32024
|
+
|
|
32025
|
+
// // Create a proxy to intercept property access and modifications
|
|
32026
|
+
// this.proxy = new Proxy(targetObject, {
|
|
32027
|
+
// set: (target, property, value) => {
|
|
32028
|
+
// const oldValue = target[property];
|
|
32029
|
+
// target[property] = value;
|
|
32030
|
+
|
|
32031
|
+
// // Call the callback with mutation information
|
|
32032
|
+
// this.callback({
|
|
32033
|
+
// type: 'update',
|
|
32034
|
+
// object: target,
|
|
32035
|
+
// property,
|
|
32036
|
+
// oldValue,
|
|
32037
|
+
// newValue: value,
|
|
32038
|
+
// });
|
|
32039
|
+
|
|
32040
|
+
// return true;
|
|
32041
|
+
// },
|
|
32042
|
+
|
|
32043
|
+
// deleteProperty: (target, property) => {
|
|
32044
|
+
// const oldValue = target[property];
|
|
32045
|
+
// const deleted = delete target[property];
|
|
32046
|
+
|
|
32047
|
+
// if (deleted) {
|
|
32048
|
+
// this.callback({
|
|
32049
|
+
// type: 'delete',
|
|
32050
|
+
// object: target,
|
|
32051
|
+
// property,
|
|
32052
|
+
// oldValue,
|
|
32053
|
+
// });
|
|
32054
|
+
// }
|
|
32055
|
+
|
|
32056
|
+
// return deleted;
|
|
32057
|
+
// },
|
|
32058
|
+
// });
|
|
32059
|
+
|
|
32060
|
+
// return this.proxy;
|
|
32061
|
+
// }
|
|
32044
32062
|
|
|
32045
|
-
|
|
32046
|
-
|
|
32047
|
-
|
|
32048
|
-
|
|
32049
|
-
|
|
32050
|
-
|
|
32051
|
-
}
|
|
32063
|
+
// // Method to stop observing (for cleanup)
|
|
32064
|
+
// disconnect() {
|
|
32065
|
+
// this.callback = null;
|
|
32066
|
+
// this.target = null;
|
|
32067
|
+
// this.proxy = null;
|
|
32068
|
+
// }
|
|
32069
|
+
// }
|
|
32052
32070
|
|
|
32053
|
-
// Usage example:
|
|
32054
|
-
const originalObject = _session.DS_GLB[paramsP.dsSessionP];
|
|
32071
|
+
// // Usage example:
|
|
32072
|
+
// const originalObject = _session.DS_GLB[paramsP.dsSessionP];
|
|
32055
32073
|
|
|
32056
|
-
// Create observer with callback
|
|
32057
|
-
const observedObject = new ObjectObserver(originalObject, (mutation) => {
|
|
32058
|
-
|
|
32059
|
-
});
|
|
32074
|
+
// // Create observer with callback
|
|
32075
|
+
// const observedObject = new ObjectObserver(originalObject, (mutation) => {
|
|
32076
|
+
// console.log('Change detected:', mutation);
|
|
32077
|
+
// });
|
|
32060
32078
|
|
|
32061
32079
|
// // These operations will trigger the callback
|
|
32062
32080
|
// observedObject.name = "Jane"; // Property update
|