@xuda.io/runtime-bundle 1.0.1342 → 1.0.1344
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 +130 -114
- package/js/xuda-runtime-bundle.min.js +2 -2
- package/js/xuda-runtime-slim.js +130 -114
- package/js/xuda-runtime-slim.min.es.js +130 -114
- package/js/xuda-runtime-slim.min.js +2 -2
- 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
|
-
|
|
28346
|
+
// function createProxy(target, path = []) {
|
|
28347
|
+
// if (watchers.has(target)) {
|
|
28348
|
+
// return watchers.get(target);
|
|
28349
|
+
// }
|
|
28351
28350
|
|
|
28352
|
-
|
|
28353
|
-
|
|
28354
|
-
|
|
28355
|
-
|
|
28351
|
+
// const proxy = new Proxy(target, {
|
|
28352
|
+
// set(obj, prop, value) {
|
|
28353
|
+
// const oldValue = obj[prop];
|
|
28354
|
+
// let currentPath = [...path, prop];
|
|
28356
28355
|
|
|
28357
|
-
|
|
28358
|
-
|
|
28356
|
+
// // Set the new value
|
|
28357
|
+
// obj[prop] = value;
|
|
28359
28358
|
|
|
28360
|
-
|
|
28361
|
-
|
|
28362
|
-
|
|
28363
|
-
|
|
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
|
+
// }
|
|
28364
28363
|
|
|
28365
|
-
|
|
28366
|
-
|
|
28367
|
-
|
|
28368
|
-
|
|
28369
|
-
|
|
28370
|
-
|
|
28371
|
-
|
|
28372
|
-
|
|
28373
|
-
|
|
28374
|
-
|
|
28375
|
-
|
|
28376
|
-
|
|
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
|
+
// }
|
|
28377
28376
|
|
|
28378
|
-
|
|
28379
|
-
|
|
28377
|
+
// return true;
|
|
28378
|
+
// },
|
|
28380
28379
|
|
|
28381
|
-
|
|
28382
|
-
|
|
28383
|
-
|
|
28380
|
+
// deleteProperty(obj, prop) {
|
|
28381
|
+
// const oldValue = obj[prop];
|
|
28382
|
+
// const currentPath = [...path, prop];
|
|
28384
28383
|
|
|
28385
|
-
|
|
28384
|
+
// delete obj[prop];
|
|
28386
28385
|
|
|
28387
|
-
|
|
28388
|
-
|
|
28389
|
-
|
|
28390
|
-
|
|
28391
|
-
|
|
28392
|
-
|
|
28393
|
-
|
|
28386
|
+
// onChange({
|
|
28387
|
+
// path: currentPath.join('.'),
|
|
28388
|
+
// oldValue,
|
|
28389
|
+
// newValue: undefined,
|
|
28390
|
+
// type: 'delete',
|
|
28391
|
+
// timestamp: Date.now(),
|
|
28392
|
+
// });
|
|
28394
28393
|
|
|
28395
|
-
|
|
28396
|
-
|
|
28397
|
-
|
|
28394
|
+
// return true;
|
|
28395
|
+
// },
|
|
28396
|
+
// });
|
|
28398
28397
|
|
|
28399
|
-
|
|
28400
|
-
|
|
28401
|
-
|
|
28402
|
-
|
|
28403
|
-
|
|
28404
|
-
|
|
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
|
+
// }
|
|
28405
28404
|
|
|
28406
|
-
|
|
28407
|
-
|
|
28408
|
-
|
|
28405
|
+
// watchers.set(target, proxy);
|
|
28406
|
+
// return proxy;
|
|
28407
|
+
// }
|
|
28409
28408
|
|
|
28410
|
-
|
|
28411
|
-
|
|
28409
|
+
// return createProxy(obj);
|
|
28410
|
+
// }
|
|
28412
28411
|
|
|
28413
|
-
|
|
28412
|
+
// let _ds = _session.DS_GLB[dsSessionP];
|
|
28414
28413
|
|
|
28415
|
-
|
|
28416
|
-
|
|
28417
|
-
|
|
28414
|
+
// // const watchedDs = createWatchedObject({ _ref: _ds }, async (change) => {
|
|
28415
|
+
// // // console.log('Change detected:', change);
|
|
28416
|
+
// // const { path, newValue, oldValue } = change;
|
|
28418
28417
|
|
|
28419
|
-
|
|
28418
|
+
// // });
|
|
28420
28419
|
|
|
28421
|
-
|
|
28422
|
-
|
|
28423
|
-
|
|
28424
|
-
|
|
28425
|
-
|
|
28426
|
-
|
|
28427
|
-
|
|
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
|
+
// },
|
|
28428
28427
|
|
|
28429
|
-
|
|
28430
|
-
|
|
28431
|
-
|
|
28432
|
-
|
|
28433
|
-
|
|
28434
|
-
|
|
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
|
+
// },
|
|
28435
28434
|
|
|
28436
|
-
|
|
28437
|
-
|
|
28438
|
-
|
|
28439
|
-
|
|
28440
|
-
|
|
28441
|
-
|
|
28442
|
-
|
|
28443
|
-
|
|
28444
|
-
|
|
28445
|
-
|
|
28446
|
-
|
|
28447
|
-
|
|
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,
|
|
@@ -42760,17 +42759,13 @@ func.index.set_ds_0_proxy = function (SESSION_ID) {
|
|
|
42760
42759
|
const fx = _session?.watchers?.[path];
|
|
42761
42760
|
fx(change);
|
|
42762
42761
|
}
|
|
42763
|
-
|
|
42764
|
-
|
|
42765
|
-
const ref_id = change.path.split('
|
|
42762
|
+
|
|
42763
|
+
///////////////////////
|
|
42764
|
+
const ref_id = change.path.split('.')[0];
|
|
42766
42765
|
if (!ref_id) return;
|
|
42767
42766
|
const _ref = SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system.SYS_GLOBAL_OBJ_REFS[ref_id];
|
|
42768
|
-
|
|
42769
42767
|
if (!_ref) return;
|
|
42770
|
-
const prefix_path = `data_system.SYS_GLOBAL_OBJ_REFS.${ref_id}.ds`;
|
|
42771
|
-
if (!change.path.includes(prefix_path)) return;
|
|
42772
42768
|
const _ds = _ref.ds;
|
|
42773
|
-
|
|
42774
42769
|
const datasource_changes = {
|
|
42775
42770
|
[_ds.dsSession]: {
|
|
42776
42771
|
['datasource_main']: {
|
|
@@ -42779,6 +42774,27 @@ func.index.set_ds_0_proxy = function (SESSION_ID) {
|
|
|
42779
42774
|
},
|
|
42780
42775
|
};
|
|
42781
42776
|
await func.datasource.update(SESSION_ID, datasource_changes);
|
|
42777
|
+
///////////////////
|
|
42778
|
+
|
|
42779
|
+
return;
|
|
42780
|
+
// if (!change.path.includes('data_system.SYS_GLOBAL_OBJ_REFS')) return;
|
|
42781
|
+
// const ref_id = change.path.split('SYS_GLOBAL_OBJ_REFS.')[1].split('.')[0];
|
|
42782
|
+
// if (!ref_id) return;
|
|
42783
|
+
// const _ref = SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system.SYS_GLOBAL_OBJ_REFS[ref_id];
|
|
42784
|
+
|
|
42785
|
+
// if (!_ref) return;
|
|
42786
|
+
// const prefix_path = `data_system.SYS_GLOBAL_OBJ_REFS.${ref_id}.ds`;
|
|
42787
|
+
// if (!change.path.includes(prefix_path)) return;
|
|
42788
|
+
// const _ds = _ref.ds;
|
|
42789
|
+
|
|
42790
|
+
// const datasource_changes = {
|
|
42791
|
+
// [_ds.dsSession]: {
|
|
42792
|
+
// ['datasource_main']: {
|
|
42793
|
+
// watcher: { path: path.replace(prefix_path + '.', ''), newValue },
|
|
42794
|
+
// },
|
|
42795
|
+
// },
|
|
42796
|
+
// };
|
|
42797
|
+
// await func.datasource.update(SESSION_ID, datasource_changes);
|
|
42782
42798
|
} catch (error) {}
|
|
42783
42799
|
});
|
|
42784
42800
|
|