@xuda.io/runtime-bundle 1.0.1341 → 1.0.1343
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 +106 -107
- package/js/xuda-runtime-bundle.min.js +1 -1
- package/js/xuda-runtime-slim.js +106 -107
- package/js/xuda-runtime-slim.min.es.js +106 -107
- package/js/xuda-runtime-slim.min.js +1 -1
- package/package.json +1 -1
|
@@ -28200,7 +28200,6 @@ func.UI.find_field_in_progUi_attributes = function (progUi, field_id, prop, tag_
|
|
|
28200
28200
|
};
|
|
28201
28201
|
|
|
28202
28202
|
func.UI.update_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
|
|
28203
|
-
return;
|
|
28204
28203
|
let ret;
|
|
28205
28204
|
const _session = SESSION_OBJ[SESSION_ID];
|
|
28206
28205
|
let _ds_0 = _session.DS_GLB[0];
|
|
@@ -28336,136 +28335,136 @@ func.UI.update_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
|
|
|
28336
28335
|
return ret;
|
|
28337
28336
|
};
|
|
28338
28337
|
|
|
28339
|
-
func.UI.create_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
|
|
28340
|
-
|
|
28341
|
-
|
|
28342
|
-
|
|
28338
|
+
// func.UI.create_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
|
|
28339
|
+
// let ret;
|
|
28340
|
+
// const _session = SESSION_OBJ[SESSION_ID];
|
|
28341
|
+
// let _ds_0 = _session.DS_GLB[0];
|
|
28343
28342
|
|
|
28344
|
-
|
|
28345
|
-
|
|
28343
|
+
// function createWatchedObject(obj, onChange) {
|
|
28344
|
+
// const watchers = new WeakMap();
|
|
28346
28345
|
|
|
28347
|
-
|
|
28348
|
-
|
|
28349
|
-
|
|
28350
|
-
|
|
28351
|
-
|
|
28352
|
-
const proxy = new Proxy(target, {
|
|
28353
|
-
set(obj, prop, value) {
|
|
28354
|
-
const oldValue = obj[prop];
|
|
28355
|
-
let currentPath = [...path, prop];
|
|
28346
|
+
// function createProxy(target, path = []) {
|
|
28347
|
+
// if (watchers.has(target)) {
|
|
28348
|
+
// return watchers.get(target);
|
|
28349
|
+
// }
|
|
28356
28350
|
|
|
28357
|
-
|
|
28358
|
-
|
|
28351
|
+
// const proxy = new Proxy(target, {
|
|
28352
|
+
// set(obj, prop, value) {
|
|
28353
|
+
// const oldValue = obj[prop];
|
|
28354
|
+
// let currentPath = [...path, prop];
|
|
28359
28355
|
|
|
28360
|
-
|
|
28361
|
-
|
|
28362
|
-
obj[prop] = createProxy(value, currentPath);
|
|
28363
|
-
}
|
|
28356
|
+
// // Set the new value
|
|
28357
|
+
// obj[prop] = value;
|
|
28364
28358
|
|
|
28365
|
-
|
|
28366
|
-
|
|
28367
|
-
|
|
28368
|
-
|
|
28369
|
-
onChange({
|
|
28370
|
-
path: currentPath.join('.'),
|
|
28371
|
-
oldValue,
|
|
28372
|
-
newValue: value,
|
|
28373
|
-
type: 'set',
|
|
28374
|
-
timestamp: Date.now(),
|
|
28375
|
-
});
|
|
28376
|
-
}
|
|
28359
|
+
// // If the new value is an object, make it observable too
|
|
28360
|
+
// if (typeof value === 'object' && value !== null) {
|
|
28361
|
+
// obj[prop] = createProxy(value, currentPath);
|
|
28362
|
+
// }
|
|
28377
28363
|
|
|
28378
|
-
|
|
28379
|
-
|
|
28364
|
+
// // Notify of change
|
|
28365
|
+
// // if (oldValue !== value) {
|
|
28366
|
+
// if (!_.isEqual(value, oldValue)) {
|
|
28367
|
+
// currentPath.shift();
|
|
28368
|
+
// onChange({
|
|
28369
|
+
// path: currentPath.join('.'),
|
|
28370
|
+
// oldValue,
|
|
28371
|
+
// newValue: value,
|
|
28372
|
+
// type: 'set',
|
|
28373
|
+
// timestamp: Date.now(),
|
|
28374
|
+
// });
|
|
28375
|
+
// }
|
|
28380
28376
|
|
|
28381
|
-
|
|
28382
|
-
|
|
28383
|
-
const currentPath = [...path, prop];
|
|
28377
|
+
// return true;
|
|
28378
|
+
// },
|
|
28384
28379
|
|
|
28385
|
-
|
|
28380
|
+
// deleteProperty(obj, prop) {
|
|
28381
|
+
// const oldValue = obj[prop];
|
|
28382
|
+
// const currentPath = [...path, prop];
|
|
28386
28383
|
|
|
28387
|
-
|
|
28388
|
-
path: currentPath.join('.'),
|
|
28389
|
-
oldValue,
|
|
28390
|
-
newValue: undefined,
|
|
28391
|
-
type: 'delete',
|
|
28392
|
-
timestamp: Date.now(),
|
|
28393
|
-
});
|
|
28384
|
+
// delete obj[prop];
|
|
28394
28385
|
|
|
28395
|
-
|
|
28396
|
-
|
|
28397
|
-
|
|
28386
|
+
// onChange({
|
|
28387
|
+
// path: currentPath.join('.'),
|
|
28388
|
+
// oldValue,
|
|
28389
|
+
// newValue: undefined,
|
|
28390
|
+
// type: 'delete',
|
|
28391
|
+
// timestamp: Date.now(),
|
|
28392
|
+
// });
|
|
28398
28393
|
|
|
28399
|
-
|
|
28400
|
-
|
|
28401
|
-
|
|
28402
|
-
target[key] = createProxy(value, [...path, key]);
|
|
28403
|
-
}
|
|
28404
|
-
}
|
|
28394
|
+
// return true;
|
|
28395
|
+
// },
|
|
28396
|
+
// });
|
|
28405
28397
|
|
|
28406
|
-
|
|
28407
|
-
|
|
28408
|
-
|
|
28398
|
+
// // Make nested objects observable
|
|
28399
|
+
// for (const [key, value] of Object.entries(target)) {
|
|
28400
|
+
// if (typeof value === 'object' && value !== null) {
|
|
28401
|
+
// target[key] = createProxy(value, [...path, key]);
|
|
28402
|
+
// }
|
|
28403
|
+
// }
|
|
28409
28404
|
|
|
28410
|
-
|
|
28411
|
-
|
|
28405
|
+
// watchers.set(target, proxy);
|
|
28406
|
+
// return proxy;
|
|
28407
|
+
// }
|
|
28412
28408
|
|
|
28413
|
-
|
|
28409
|
+
// return createProxy(obj);
|
|
28410
|
+
// }
|
|
28414
28411
|
|
|
28415
|
-
|
|
28416
|
-
// // console.log('Change detected:', change);
|
|
28417
|
-
// const { path, newValue, oldValue } = change;
|
|
28412
|
+
// let _ds = _session.DS_GLB[dsSessionP];
|
|
28418
28413
|
|
|
28419
|
-
|
|
28414
|
+
// // const watchedDs = createWatchedObject({ _ref: _ds }, async (change) => {
|
|
28415
|
+
// // // console.log('Change detected:', change);
|
|
28416
|
+
// // const { path, newValue, oldValue } = change;
|
|
28420
28417
|
|
|
28421
|
-
|
|
28422
|
-
return new Proxy(target, {
|
|
28423
|
-
// Intercept property access
|
|
28424
|
-
get(obj, prop) {
|
|
28425
|
-
console.log(`Getting property: ${String(prop)}`);
|
|
28426
|
-
return prop in obj ? obj[prop] : `Property ${String(prop)} not found`;
|
|
28427
|
-
},
|
|
28418
|
+
// // });
|
|
28428
28419
|
|
|
28429
|
-
|
|
28430
|
-
|
|
28431
|
-
|
|
28432
|
-
|
|
28433
|
-
|
|
28434
|
-
|
|
28420
|
+
// const createBasicProxy = (target) => {
|
|
28421
|
+
// return new Proxy(target, {
|
|
28422
|
+
// // Intercept property access
|
|
28423
|
+
// get(obj, prop) {
|
|
28424
|
+
// console.log(`Getting property: ${String(prop)}`);
|
|
28425
|
+
// return prop in obj ? obj[prop] : `Property ${String(prop)} not found`;
|
|
28426
|
+
// },
|
|
28435
28427
|
|
|
28436
|
-
|
|
28437
|
-
|
|
28438
|
-
|
|
28439
|
-
|
|
28440
|
-
|
|
28441
|
-
|
|
28442
|
-
}
|
|
28443
|
-
return false;
|
|
28444
|
-
},
|
|
28445
|
-
});
|
|
28446
|
-
};
|
|
28428
|
+
// // Intercept property assignment
|
|
28429
|
+
// set(obj, prop, value) {
|
|
28430
|
+
// console.log(`Setting property: ${String(prop)} to ${value}`);
|
|
28431
|
+
// obj[prop] = value;
|
|
28432
|
+
// return true; // indicates success
|
|
28433
|
+
// },
|
|
28447
28434
|
|
|
28448
|
-
|
|
28449
|
-
|
|
28450
|
-
|
|
28451
|
-
|
|
28452
|
-
|
|
28453
|
-
|
|
28454
|
-
|
|
28455
|
-
|
|
28435
|
+
// // Intercept property deletion
|
|
28436
|
+
// deleteProperty(obj, prop) {
|
|
28437
|
+
// console.log(`Deleting property: ${String(prop)}`);
|
|
28438
|
+
// if (prop in obj) {
|
|
28439
|
+
// delete obj[prop];
|
|
28440
|
+
// return true;
|
|
28441
|
+
// }
|
|
28442
|
+
// return false;
|
|
28443
|
+
// },
|
|
28444
|
+
// });
|
|
28445
|
+
// };
|
|
28446
|
+
// const p = createBasicProxy(_ds);
|
|
28447
|
+
// // let obj = { ds: watchedDs._ref, data: {}, props: _ds.in_parameters || {} };
|
|
28448
|
+
// let obj = { ds: {}, data: {}, props: _ds.in_parameters || {} };
|
|
28449
|
+
// try {
|
|
28450
|
+
// const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
|
|
28451
|
+
// obj.data = _ds?.data_feed?.rows?.[row_idx];
|
|
28452
|
+
// } catch (error) {
|
|
28453
|
+
// // error normal if find_ROWID_idx fail
|
|
28454
|
+
// }
|
|
28456
28455
|
|
|
28457
|
-
|
|
28456
|
+
// let SYS_GLOBAL_OBJ_REFS = _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'];
|
|
28458
28457
|
|
|
28459
|
-
|
|
28460
|
-
|
|
28461
|
-
|
|
28462
|
-
|
|
28463
|
-
|
|
28458
|
+
// if ($elm) {
|
|
28459
|
+
// const attributes = $elm?.data()?.xuData?.xuPanelProps || $elm?.data()?.xuData?.debug_info?.attribute_stat || {};
|
|
28460
|
+
// obj.attributes = attributes;
|
|
28461
|
+
// obj.xu_ui_id = $elm.attr('xu-ui-id');
|
|
28462
|
+
// }
|
|
28464
28463
|
|
|
28465
|
-
|
|
28464
|
+
// SYS_GLOBAL_OBJ_REFS[ref_field_id] = obj;
|
|
28466
28465
|
|
|
28467
|
-
|
|
28468
|
-
};
|
|
28466
|
+
// return ret;
|
|
28467
|
+
// };
|
|
28469
28468
|
func.datasource = {};
|
|
28470
28469
|
func.datasource.create = async function (
|
|
28471
28470
|
SESSION_ID,
|