@xuda.io/runtime-bundle 1.0.1319 → 1.0.1321
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.
|
@@ -28192,73 +28192,73 @@ func.UI.update_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
|
|
|
28192
28192
|
|
|
28193
28193
|
const _ds = func.utils.clean_returned_datasource(SESSION_ID, dsSessionP);
|
|
28194
28194
|
|
|
28195
|
-
function createWatchedObject(obj, onChange) {
|
|
28196
|
-
|
|
28197
|
-
|
|
28198
|
-
function createProxy(target, path = []) {
|
|
28199
|
-
if (watchers.has(target)) {
|
|
28200
|
-
return watchers.get(target);
|
|
28201
|
-
}
|
|
28202
|
-
|
|
28203
|
-
const proxy = new Proxy(target, {
|
|
28204
|
-
set(obj, prop, value) {
|
|
28205
|
-
const oldValue = obj[prop];
|
|
28206
|
-
let currentPath = [...path, prop];
|
|
28207
|
-
|
|
28208
|
-
// Set the new value
|
|
28209
|
-
obj[prop] = value;
|
|
28210
|
-
|
|
28211
|
-
// If the new value is an object, make it observable too
|
|
28212
|
-
if (typeof value === 'object' && value !== null) {
|
|
28213
|
-
obj[prop] = createProxy(value, currentPath);
|
|
28214
|
-
}
|
|
28195
|
+
// function createWatchedObject(obj, onChange) {
|
|
28196
|
+
// const watchers = new WeakMap();
|
|
28215
28197
|
|
|
28216
|
-
|
|
28217
|
-
|
|
28218
|
-
|
|
28219
|
-
|
|
28220
|
-
path: currentPath.join('.'),
|
|
28221
|
-
oldValue,
|
|
28222
|
-
newValue: value,
|
|
28223
|
-
type: 'set',
|
|
28224
|
-
timestamp: Date.now(),
|
|
28225
|
-
});
|
|
28226
|
-
}
|
|
28198
|
+
// function createProxy(target, path = []) {
|
|
28199
|
+
// if (watchers.has(target)) {
|
|
28200
|
+
// return watchers.get(target);
|
|
28201
|
+
// }
|
|
28227
28202
|
|
|
28228
|
-
|
|
28229
|
-
|
|
28203
|
+
// const proxy = new Proxy(target, {
|
|
28204
|
+
// set(obj, prop, value) {
|
|
28205
|
+
// const oldValue = obj[prop];
|
|
28206
|
+
// let currentPath = [...path, prop];
|
|
28207
|
+
|
|
28208
|
+
// // Set the new value
|
|
28209
|
+
// obj[prop] = value;
|
|
28210
|
+
|
|
28211
|
+
// // If the new value is an object, make it observable too
|
|
28212
|
+
// if (typeof value === 'object' && value !== null) {
|
|
28213
|
+
// obj[prop] = createProxy(value, currentPath);
|
|
28214
|
+
// }
|
|
28215
|
+
|
|
28216
|
+
// // Notify of change
|
|
28217
|
+
// if (oldValue !== value) {
|
|
28218
|
+
// currentPath.shift();
|
|
28219
|
+
// onChange({
|
|
28220
|
+
// path: currentPath.join('.'),
|
|
28221
|
+
// oldValue,
|
|
28222
|
+
// newValue: value,
|
|
28223
|
+
// type: 'set',
|
|
28224
|
+
// timestamp: Date.now(),
|
|
28225
|
+
// });
|
|
28226
|
+
// }
|
|
28227
|
+
|
|
28228
|
+
// return true;
|
|
28229
|
+
// },
|
|
28230
28230
|
|
|
28231
|
-
|
|
28232
|
-
|
|
28233
|
-
|
|
28231
|
+
// deleteProperty(obj, prop) {
|
|
28232
|
+
// const oldValue = obj[prop];
|
|
28233
|
+
// const currentPath = [...path, prop];
|
|
28234
28234
|
|
|
28235
|
-
|
|
28235
|
+
// delete obj[prop];
|
|
28236
28236
|
|
|
28237
|
-
|
|
28238
|
-
|
|
28239
|
-
|
|
28240
|
-
|
|
28241
|
-
|
|
28242
|
-
|
|
28243
|
-
|
|
28237
|
+
// onChange({
|
|
28238
|
+
// path: currentPath.join('.'),
|
|
28239
|
+
// oldValue,
|
|
28240
|
+
// newValue: undefined,
|
|
28241
|
+
// type: 'delete',
|
|
28242
|
+
// timestamp: Date.now(),
|
|
28243
|
+
// });
|
|
28244
28244
|
|
|
28245
|
-
|
|
28246
|
-
|
|
28247
|
-
|
|
28245
|
+
// return true;
|
|
28246
|
+
// },
|
|
28247
|
+
// });
|
|
28248
28248
|
|
|
28249
|
-
|
|
28250
|
-
|
|
28251
|
-
|
|
28252
|
-
|
|
28253
|
-
|
|
28254
|
-
|
|
28249
|
+
// // Make nested objects observable
|
|
28250
|
+
// for (const [key, value] of Object.entries(target)) {
|
|
28251
|
+
// if (typeof value === 'object' && value !== null) {
|
|
28252
|
+
// target[key] = createProxy(value, [...path, key]);
|
|
28253
|
+
// }
|
|
28254
|
+
// }
|
|
28255
28255
|
|
|
28256
|
-
|
|
28257
|
-
|
|
28258
|
-
|
|
28256
|
+
// watchers.set(target, proxy);
|
|
28257
|
+
// return proxy;
|
|
28258
|
+
// }
|
|
28259
28259
|
|
|
28260
|
-
|
|
28261
|
-
}
|
|
28260
|
+
// return createProxy(obj);
|
|
28261
|
+
// }
|
|
28262
28262
|
|
|
28263
28263
|
// const watchedDs = createWatchedObject({ _ref: _ds }, async (change) => {
|
|
28264
28264
|
// // console.log('Change detected:', change);
|
|
@@ -28277,7 +28277,8 @@ func.UI.update_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
|
|
|
28277
28277
|
|
|
28278
28278
|
//////////////
|
|
28279
28279
|
|
|
28280
|
-
let obj = { ds: watchedDs._ref, data: {}, props: _ds.in_parameters || {} };
|
|
28280
|
+
// let obj = { ds: watchedDs._ref, data: {}, props: _ds.in_parameters || {} };
|
|
28281
|
+
let obj = { ds: _ds, data: {}, props: _ds.in_parameters || {} };
|
|
28281
28282
|
try {
|
|
28282
28283
|
const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
|
|
28283
28284
|
obj.data = _ds?.data_feed?.rows?.[row_idx];
|
|
@@ -42588,7 +42589,7 @@ func.index.set_ds_0_proxy = function (SESSION_ID) {
|
|
|
42588
42589
|
if (_.isEqual(newValue, oldValue)) return;
|
|
42589
42590
|
|
|
42590
42591
|
if (change.path.includes('data_system.SYS_GLOBAL_OBJ_REFS')) {
|
|
42591
|
-
const ref_id =
|
|
42592
|
+
const ref_id = change.path.split('SYS_GLOBAL_OBJ_REFS.')[1].split('.')[0];
|
|
42592
42593
|
// const datasource_changes = {
|
|
42593
42594
|
// [dsSessionP]: {
|
|
42594
42595
|
// ['datasource_main']: {
|