@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.
@@ -9061,73 +9061,73 @@ func.UI.update_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
9061
9061
 
9062
9062
  const _ds = func.utils.clean_returned_datasource(SESSION_ID, dsSessionP);
9063
9063
 
9064
- function createWatchedObject(obj, onChange) {
9065
- const watchers = new WeakMap();
9066
-
9067
- function createProxy(target, path = []) {
9068
- if (watchers.has(target)) {
9069
- return watchers.get(target);
9070
- }
9071
-
9072
- const proxy = new Proxy(target, {
9073
- set(obj, prop, value) {
9074
- const oldValue = obj[prop];
9075
- let currentPath = [...path, prop];
9076
-
9077
- // Set the new value
9078
- obj[prop] = value;
9079
-
9080
- // If the new value is an object, make it observable too
9081
- if (typeof value === 'object' && value !== null) {
9082
- obj[prop] = createProxy(value, currentPath);
9083
- }
9064
+ // function createWatchedObject(obj, onChange) {
9065
+ // const watchers = new WeakMap();
9084
9066
 
9085
- // Notify of change
9086
- if (oldValue !== value) {
9087
- currentPath.shift();
9088
- onChange({
9089
- path: currentPath.join('.'),
9090
- oldValue,
9091
- newValue: value,
9092
- type: 'set',
9093
- timestamp: Date.now(),
9094
- });
9095
- }
9067
+ // function createProxy(target, path = []) {
9068
+ // if (watchers.has(target)) {
9069
+ // return watchers.get(target);
9070
+ // }
9096
9071
 
9097
- return true;
9098
- },
9072
+ // const proxy = new Proxy(target, {
9073
+ // set(obj, prop, value) {
9074
+ // const oldValue = obj[prop];
9075
+ // let currentPath = [...path, prop];
9076
+
9077
+ // // Set the new value
9078
+ // obj[prop] = value;
9079
+
9080
+ // // If the new value is an object, make it observable too
9081
+ // if (typeof value === 'object' && value !== null) {
9082
+ // obj[prop] = createProxy(value, currentPath);
9083
+ // }
9084
+
9085
+ // // Notify of change
9086
+ // if (oldValue !== value) {
9087
+ // currentPath.shift();
9088
+ // onChange({
9089
+ // path: currentPath.join('.'),
9090
+ // oldValue,
9091
+ // newValue: value,
9092
+ // type: 'set',
9093
+ // timestamp: Date.now(),
9094
+ // });
9095
+ // }
9096
+
9097
+ // return true;
9098
+ // },
9099
9099
 
9100
- deleteProperty(obj, prop) {
9101
- const oldValue = obj[prop];
9102
- const currentPath = [...path, prop];
9100
+ // deleteProperty(obj, prop) {
9101
+ // const oldValue = obj[prop];
9102
+ // const currentPath = [...path, prop];
9103
9103
 
9104
- delete obj[prop];
9104
+ // delete obj[prop];
9105
9105
 
9106
- onChange({
9107
- path: currentPath.join('.'),
9108
- oldValue,
9109
- newValue: undefined,
9110
- type: 'delete',
9111
- timestamp: Date.now(),
9112
- });
9106
+ // onChange({
9107
+ // path: currentPath.join('.'),
9108
+ // oldValue,
9109
+ // newValue: undefined,
9110
+ // type: 'delete',
9111
+ // timestamp: Date.now(),
9112
+ // });
9113
9113
 
9114
- return true;
9115
- },
9116
- });
9114
+ // return true;
9115
+ // },
9116
+ // });
9117
9117
 
9118
- // Make nested objects observable
9119
- for (const [key, value] of Object.entries(target)) {
9120
- if (typeof value === 'object' && value !== null) {
9121
- target[key] = createProxy(value, [...path, key]);
9122
- }
9123
- }
9118
+ // // Make nested objects observable
9119
+ // for (const [key, value] of Object.entries(target)) {
9120
+ // if (typeof value === 'object' && value !== null) {
9121
+ // target[key] = createProxy(value, [...path, key]);
9122
+ // }
9123
+ // }
9124
9124
 
9125
- watchers.set(target, proxy);
9126
- return proxy;
9127
- }
9125
+ // watchers.set(target, proxy);
9126
+ // return proxy;
9127
+ // }
9128
9128
 
9129
- return createProxy(obj);
9130
- }
9129
+ // return createProxy(obj);
9130
+ // }
9131
9131
 
9132
9132
  // const watchedDs = createWatchedObject({ _ref: _ds }, async (change) => {
9133
9133
  // // console.log('Change detected:', change);
@@ -9146,7 +9146,8 @@ func.UI.update_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
9146
9146
 
9147
9147
  //////////////
9148
9148
 
9149
- let obj = { ds: watchedDs._ref, data: {}, props: _ds.in_parameters || {} };
9149
+ // let obj = { ds: watchedDs._ref, data: {}, props: _ds.in_parameters || {} };
9150
+ let obj = { ds: _ds, data: {}, props: _ds.in_parameters || {} };
9150
9151
  try {
9151
9152
  const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
9152
9153
  obj.data = _ds?.data_feed?.rows?.[row_idx];
@@ -20101,7 +20102,7 @@ func.index.set_ds_0_proxy = function (SESSION_ID) {
20101
20102
  if (_.isEqual(newValue, oldValue)) return;
20102
20103
 
20103
20104
  if (change.path.includes('data_system.SYS_GLOBAL_OBJ_REFS')) {
20104
- const ref_id = str.split('SYS_GLOBAL_OBJ_REFS.')[1].split('.')[0];
20105
+ const ref_id = change.path.split('SYS_GLOBAL_OBJ_REFS.')[1].split('.')[0];
20105
20106
  // const datasource_changes = {
20106
20107
  // [dsSessionP]: {
20107
20108
  // ['datasource_main']: {
@@ -9062,73 +9062,73 @@ func.UI.update_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
9062
9062
 
9063
9063
  const _ds = func.utils.clean_returned_datasource(SESSION_ID, dsSessionP);
9064
9064
 
9065
- function createWatchedObject(obj, onChange) {
9066
- const watchers = new WeakMap();
9067
-
9068
- function createProxy(target, path = []) {
9069
- if (watchers.has(target)) {
9070
- return watchers.get(target);
9071
- }
9072
-
9073
- const proxy = new Proxy(target, {
9074
- set(obj, prop, value) {
9075
- const oldValue = obj[prop];
9076
- let currentPath = [...path, prop];
9077
-
9078
- // Set the new value
9079
- obj[prop] = value;
9080
-
9081
- // If the new value is an object, make it observable too
9082
- if (typeof value === 'object' && value !== null) {
9083
- obj[prop] = createProxy(value, currentPath);
9084
- }
9065
+ // function createWatchedObject(obj, onChange) {
9066
+ // const watchers = new WeakMap();
9085
9067
 
9086
- // Notify of change
9087
- if (oldValue !== value) {
9088
- currentPath.shift();
9089
- onChange({
9090
- path: currentPath.join('.'),
9091
- oldValue,
9092
- newValue: value,
9093
- type: 'set',
9094
- timestamp: Date.now(),
9095
- });
9096
- }
9068
+ // function createProxy(target, path = []) {
9069
+ // if (watchers.has(target)) {
9070
+ // return watchers.get(target);
9071
+ // }
9097
9072
 
9098
- return true;
9099
- },
9073
+ // const proxy = new Proxy(target, {
9074
+ // set(obj, prop, value) {
9075
+ // const oldValue = obj[prop];
9076
+ // let currentPath = [...path, prop];
9077
+
9078
+ // // Set the new value
9079
+ // obj[prop] = value;
9080
+
9081
+ // // If the new value is an object, make it observable too
9082
+ // if (typeof value === 'object' && value !== null) {
9083
+ // obj[prop] = createProxy(value, currentPath);
9084
+ // }
9085
+
9086
+ // // Notify of change
9087
+ // if (oldValue !== value) {
9088
+ // currentPath.shift();
9089
+ // onChange({
9090
+ // path: currentPath.join('.'),
9091
+ // oldValue,
9092
+ // newValue: value,
9093
+ // type: 'set',
9094
+ // timestamp: Date.now(),
9095
+ // });
9096
+ // }
9097
+
9098
+ // return true;
9099
+ // },
9100
9100
 
9101
- deleteProperty(obj, prop) {
9102
- const oldValue = obj[prop];
9103
- const currentPath = [...path, prop];
9101
+ // deleteProperty(obj, prop) {
9102
+ // const oldValue = obj[prop];
9103
+ // const currentPath = [...path, prop];
9104
9104
 
9105
- delete obj[prop];
9105
+ // delete obj[prop];
9106
9106
 
9107
- onChange({
9108
- path: currentPath.join('.'),
9109
- oldValue,
9110
- newValue: undefined,
9111
- type: 'delete',
9112
- timestamp: Date.now(),
9113
- });
9107
+ // onChange({
9108
+ // path: currentPath.join('.'),
9109
+ // oldValue,
9110
+ // newValue: undefined,
9111
+ // type: 'delete',
9112
+ // timestamp: Date.now(),
9113
+ // });
9114
9114
 
9115
- return true;
9116
- },
9117
- });
9115
+ // return true;
9116
+ // },
9117
+ // });
9118
9118
 
9119
- // Make nested objects observable
9120
- for (const [key, value] of Object.entries(target)) {
9121
- if (typeof value === 'object' && value !== null) {
9122
- target[key] = createProxy(value, [...path, key]);
9123
- }
9124
- }
9119
+ // // Make nested objects observable
9120
+ // for (const [key, value] of Object.entries(target)) {
9121
+ // if (typeof value === 'object' && value !== null) {
9122
+ // target[key] = createProxy(value, [...path, key]);
9123
+ // }
9124
+ // }
9125
9125
 
9126
- watchers.set(target, proxy);
9127
- return proxy;
9128
- }
9126
+ // watchers.set(target, proxy);
9127
+ // return proxy;
9128
+ // }
9129
9129
 
9130
- return createProxy(obj);
9131
- }
9130
+ // return createProxy(obj);
9131
+ // }
9132
9132
 
9133
9133
  // const watchedDs = createWatchedObject({ _ref: _ds }, async (change) => {
9134
9134
  // // console.log('Change detected:', change);
@@ -9147,7 +9147,8 @@ func.UI.update_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
9147
9147
 
9148
9148
  //////////////
9149
9149
 
9150
- let obj = { ds: watchedDs._ref, data: {}, props: _ds.in_parameters || {} };
9150
+ // let obj = { ds: watchedDs._ref, data: {}, props: _ds.in_parameters || {} };
9151
+ let obj = { ds: _ds, data: {}, props: _ds.in_parameters || {} };
9151
9152
  try {
9152
9153
  const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
9153
9154
  obj.data = _ds?.data_feed?.rows?.[row_idx];
@@ -20102,7 +20103,7 @@ func.index.set_ds_0_proxy = function (SESSION_ID) {
20102
20103
  if (_.isEqual(newValue, oldValue)) return;
20103
20104
 
20104
20105
  if (change.path.includes('data_system.SYS_GLOBAL_OBJ_REFS')) {
20105
- const ref_id = str.split('SYS_GLOBAL_OBJ_REFS.')[1].split('.')[0];
20106
+ const ref_id = change.path.split('SYS_GLOBAL_OBJ_REFS.')[1].split('.')[0];
20106
20107
  // const datasource_changes = {
20107
20108
  // [dsSessionP]: {
20108
20109
  // ['datasource_main']: {