@xuda.io/runtime-bundle 1.0.1282 → 1.0.1284
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.
|
@@ -28149,50 +28149,6 @@ func.UI.update_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
|
|
|
28149
28149
|
|
|
28150
28150
|
const _ds = func.utils.clean_returned_datasource(SESSION_ID, dsSessionP);
|
|
28151
28151
|
|
|
28152
|
-
//////////////
|
|
28153
|
-
// function createWatchedObject(obj, onChange) {
|
|
28154
|
-
// return new Proxy(obj, {
|
|
28155
|
-
// set(target, property, value) {
|
|
28156
|
-
// const oldValue = target[property];
|
|
28157
|
-
// target[property] = value;
|
|
28158
|
-
|
|
28159
|
-
// if (oldValue !== value) {
|
|
28160
|
-
// onChange({
|
|
28161
|
-
// property,
|
|
28162
|
-
// oldValue,
|
|
28163
|
-
// newValue: value,
|
|
28164
|
-
// timestamp: new Date(),
|
|
28165
|
-
// });
|
|
28166
|
-
// }
|
|
28167
|
-
|
|
28168
|
-
// return true;
|
|
28169
|
-
// },
|
|
28170
|
-
|
|
28171
|
-
// deleteProperty(target, property) {
|
|
28172
|
-
// const oldValue = target[property];
|
|
28173
|
-
// delete target[property];
|
|
28174
|
-
|
|
28175
|
-
// onChange({
|
|
28176
|
-
// property,
|
|
28177
|
-
// oldValue,
|
|
28178
|
-
// newValue: undefined,
|
|
28179
|
-
// deleted: true,
|
|
28180
|
-
// timestamp: new Date(),
|
|
28181
|
-
// });
|
|
28182
|
-
|
|
28183
|
-
// return true;
|
|
28184
|
-
// },
|
|
28185
|
-
// });
|
|
28186
|
-
// }
|
|
28187
|
-
|
|
28188
|
-
// // Usage
|
|
28189
|
-
// const watchedUser = createWatchedObject(
|
|
28190
|
-
// { name: "John", age: 25 },
|
|
28191
|
-
// (change) => console.log("Change detected:", change)
|
|
28192
|
-
// );
|
|
28193
|
-
|
|
28194
|
-
// watchedUser.age = 26; // Logs: Change detected: { property: "age", oldValue: 25, newValue: 26, ... }
|
|
28195
|
-
|
|
28196
28152
|
function createWatchedObject(obj, onChange) {
|
|
28197
28153
|
const watchers = new WeakMap();
|
|
28198
28154
|
|
|
@@ -28264,11 +28220,21 @@ func.UI.update_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
|
|
|
28264
28220
|
console.log('Change detected:', change);
|
|
28265
28221
|
const { path, newValue } = change;
|
|
28266
28222
|
try {
|
|
28267
|
-
_session.DS_GLB[dsSessionP].watcher = { path, newValue };
|
|
28223
|
+
// _session.DS_GLB[dsSessionP].watcher = { path, newValue };
|
|
28268
28224
|
|
|
28269
|
-
|
|
28225
|
+
const datasource_changes = {
|
|
28226
|
+
[dsSessionP]: {
|
|
28227
|
+
['datasource_main']: {
|
|
28228
|
+
watcher: { path, newValue },
|
|
28229
|
+
},
|
|
28230
|
+
},
|
|
28231
|
+
};
|
|
28232
|
+
await func.datasource.update(SESSION_ID, datasource_changes);
|
|
28270
28233
|
|
|
28271
|
-
|
|
28234
|
+
// _.set(_session.DS_GLB[dsSessionP].watcher, change.path, change.newValue);
|
|
28235
|
+
setTimeout(() => {
|
|
28236
|
+
func.action.execute(SESSION_ID, 'act_refresh', _session.DS_GLB[dsSessionP], null, null, null, $elm);
|
|
28237
|
+
}, 1000);
|
|
28272
28238
|
} catch (error) {}
|
|
28273
28239
|
});
|
|
28274
28240
|
|