@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.
@@ -9069,7 +9069,6 @@ func.UI.find_field_in_progUi_attributes = function (progUi, field_id, prop, tag_
9069
9069
  };
9070
9070
 
9071
9071
  func.UI.update_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
9072
- return;
9073
9072
  let ret;
9074
9073
  const _session = SESSION_OBJ[SESSION_ID];
9075
9074
  let _ds_0 = _session.DS_GLB[0];
@@ -9205,136 +9204,136 @@ func.UI.update_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
9205
9204
  return ret;
9206
9205
  };
9207
9206
 
9208
- func.UI.create_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
9209
- let ret;
9210
- const _session = SESSION_OBJ[SESSION_ID];
9211
- let _ds_0 = _session.DS_GLB[0];
9207
+ // func.UI.create_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
9208
+ // let ret;
9209
+ // const _session = SESSION_OBJ[SESSION_ID];
9210
+ // let _ds_0 = _session.DS_GLB[0];
9212
9211
 
9213
- function createWatchedObject(obj, onChange) {
9214
- const watchers = new WeakMap();
9212
+ // function createWatchedObject(obj, onChange) {
9213
+ // const watchers = new WeakMap();
9215
9214
 
9216
- function createProxy(target, path = []) {
9217
- if (watchers.has(target)) {
9218
- return watchers.get(target);
9219
- }
9220
-
9221
- const proxy = new Proxy(target, {
9222
- set(obj, prop, value) {
9223
- const oldValue = obj[prop];
9224
- let currentPath = [...path, prop];
9215
+ // function createProxy(target, path = []) {
9216
+ // if (watchers.has(target)) {
9217
+ // return watchers.get(target);
9218
+ // }
9225
9219
 
9226
- // Set the new value
9227
- obj[prop] = value;
9220
+ // const proxy = new Proxy(target, {
9221
+ // set(obj, prop, value) {
9222
+ // const oldValue = obj[prop];
9223
+ // let currentPath = [...path, prop];
9228
9224
 
9229
- // If the new value is an object, make it observable too
9230
- if (typeof value === 'object' && value !== null) {
9231
- obj[prop] = createProxy(value, currentPath);
9232
- }
9225
+ // // Set the new value
9226
+ // obj[prop] = value;
9233
9227
 
9234
- // Notify of change
9235
- // if (oldValue !== value) {
9236
- if (!_.isEqual(value, oldValue)) {
9237
- currentPath.shift();
9238
- onChange({
9239
- path: currentPath.join('.'),
9240
- oldValue,
9241
- newValue: value,
9242
- type: 'set',
9243
- timestamp: Date.now(),
9244
- });
9245
- }
9228
+ // // If the new value is an object, make it observable too
9229
+ // if (typeof value === 'object' && value !== null) {
9230
+ // obj[prop] = createProxy(value, currentPath);
9231
+ // }
9246
9232
 
9247
- return true;
9248
- },
9233
+ // // Notify of change
9234
+ // // if (oldValue !== value) {
9235
+ // if (!_.isEqual(value, oldValue)) {
9236
+ // currentPath.shift();
9237
+ // onChange({
9238
+ // path: currentPath.join('.'),
9239
+ // oldValue,
9240
+ // newValue: value,
9241
+ // type: 'set',
9242
+ // timestamp: Date.now(),
9243
+ // });
9244
+ // }
9249
9245
 
9250
- deleteProperty(obj, prop) {
9251
- const oldValue = obj[prop];
9252
- const currentPath = [...path, prop];
9246
+ // return true;
9247
+ // },
9253
9248
 
9254
- delete obj[prop];
9249
+ // deleteProperty(obj, prop) {
9250
+ // const oldValue = obj[prop];
9251
+ // const currentPath = [...path, prop];
9255
9252
 
9256
- onChange({
9257
- path: currentPath.join('.'),
9258
- oldValue,
9259
- newValue: undefined,
9260
- type: 'delete',
9261
- timestamp: Date.now(),
9262
- });
9253
+ // delete obj[prop];
9263
9254
 
9264
- return true;
9265
- },
9266
- });
9255
+ // onChange({
9256
+ // path: currentPath.join('.'),
9257
+ // oldValue,
9258
+ // newValue: undefined,
9259
+ // type: 'delete',
9260
+ // timestamp: Date.now(),
9261
+ // });
9267
9262
 
9268
- // Make nested objects observable
9269
- for (const [key, value] of Object.entries(target)) {
9270
- if (typeof value === 'object' && value !== null) {
9271
- target[key] = createProxy(value, [...path, key]);
9272
- }
9273
- }
9263
+ // return true;
9264
+ // },
9265
+ // });
9274
9266
 
9275
- watchers.set(target, proxy);
9276
- return proxy;
9277
- }
9267
+ // // Make nested objects observable
9268
+ // for (const [key, value] of Object.entries(target)) {
9269
+ // if (typeof value === 'object' && value !== null) {
9270
+ // target[key] = createProxy(value, [...path, key]);
9271
+ // }
9272
+ // }
9278
9273
 
9279
- return createProxy(obj);
9280
- }
9274
+ // watchers.set(target, proxy);
9275
+ // return proxy;
9276
+ // }
9281
9277
 
9282
- let _ds = _session.DS_GLB[dsSessionP];
9278
+ // return createProxy(obj);
9279
+ // }
9283
9280
 
9284
- // const watchedDs = createWatchedObject({ _ref: _ds }, async (change) => {
9285
- // // console.log('Change detected:', change);
9286
- // const { path, newValue, oldValue } = change;
9281
+ // let _ds = _session.DS_GLB[dsSessionP];
9287
9282
 
9288
- // });
9283
+ // // const watchedDs = createWatchedObject({ _ref: _ds }, async (change) => {
9284
+ // // // console.log('Change detected:', change);
9285
+ // // const { path, newValue, oldValue } = change;
9289
9286
 
9290
- const createBasicProxy = (target) => {
9291
- return new Proxy(target, {
9292
- // Intercept property access
9293
- get(obj, prop) {
9294
- console.log(`Getting property: ${String(prop)}`);
9295
- return prop in obj ? obj[prop] : `Property ${String(prop)} not found`;
9296
- },
9287
+ // // });
9297
9288
 
9298
- // Intercept property assignment
9299
- set(obj, prop, value) {
9300
- console.log(`Setting property: ${String(prop)} to ${value}`);
9301
- obj[prop] = value;
9302
- return true; // indicates success
9303
- },
9289
+ // const createBasicProxy = (target) => {
9290
+ // return new Proxy(target, {
9291
+ // // Intercept property access
9292
+ // get(obj, prop) {
9293
+ // console.log(`Getting property: ${String(prop)}`);
9294
+ // return prop in obj ? obj[prop] : `Property ${String(prop)} not found`;
9295
+ // },
9304
9296
 
9305
- // Intercept property deletion
9306
- deleteProperty(obj, prop) {
9307
- console.log(`Deleting property: ${String(prop)}`);
9308
- if (prop in obj) {
9309
- delete obj[prop];
9310
- return true;
9311
- }
9312
- return false;
9313
- },
9314
- });
9315
- };
9297
+ // // Intercept property assignment
9298
+ // set(obj, prop, value) {
9299
+ // console.log(`Setting property: ${String(prop)} to ${value}`);
9300
+ // obj[prop] = value;
9301
+ // return true; // indicates success
9302
+ // },
9316
9303
 
9317
- // let obj = { ds: watchedDs._ref, data: {}, props: _ds.in_parameters || {} };
9318
- let obj = { ds: createBasicProxy(_ds), data: {}, props: _ds.in_parameters || {} };
9319
- try {
9320
- const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
9321
- obj.data = _ds?.data_feed?.rows?.[row_idx];
9322
- } catch (error) {
9323
- // error normal if find_ROWID_idx fail
9324
- }
9304
+ // // Intercept property deletion
9305
+ // deleteProperty(obj, prop) {
9306
+ // console.log(`Deleting property: ${String(prop)}`);
9307
+ // if (prop in obj) {
9308
+ // delete obj[prop];
9309
+ // return true;
9310
+ // }
9311
+ // return false;
9312
+ // },
9313
+ // });
9314
+ // };
9315
+ // const p = createBasicProxy(_ds);
9316
+ // // let obj = { ds: watchedDs._ref, data: {}, props: _ds.in_parameters || {} };
9317
+ // let obj = { ds: {}, data: {}, props: _ds.in_parameters || {} };
9318
+ // try {
9319
+ // const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
9320
+ // obj.data = _ds?.data_feed?.rows?.[row_idx];
9321
+ // } catch (error) {
9322
+ // // error normal if find_ROWID_idx fail
9323
+ // }
9325
9324
 
9326
- let SYS_GLOBAL_OBJ_REFS = _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'];
9325
+ // let SYS_GLOBAL_OBJ_REFS = _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'];
9327
9326
 
9328
- if ($elm) {
9329
- const attributes = $elm?.data()?.xuData?.xuPanelProps || $elm?.data()?.xuData?.debug_info?.attribute_stat || {};
9330
- obj.attributes = attributes;
9331
- obj.xu_ui_id = $elm.attr('xu-ui-id');
9332
- }
9327
+ // if ($elm) {
9328
+ // const attributes = $elm?.data()?.xuData?.xuPanelProps || $elm?.data()?.xuData?.debug_info?.attribute_stat || {};
9329
+ // obj.attributes = attributes;
9330
+ // obj.xu_ui_id = $elm.attr('xu-ui-id');
9331
+ // }
9333
9332
 
9334
- SYS_GLOBAL_OBJ_REFS[ref_field_id] = obj;
9333
+ // SYS_GLOBAL_OBJ_REFS[ref_field_id] = obj;
9335
9334
 
9336
- return ret;
9337
- };
9335
+ // return ret;
9336
+ // };
9338
9337
  func.events = {};
9339
9338
  func.events.validate = async function (SESSION_ID, triggerP, dsSessionP, eventIdP, sourceP, argumentsP, return_validation_onlyP) {
9340
9339
  var _session = SESSION_OBJ[SESSION_ID];
@@ -9070,7 +9070,6 @@ func.UI.find_field_in_progUi_attributes = function (progUi, field_id, prop, tag_
9070
9070
  };
9071
9071
 
9072
9072
  func.UI.update_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
9073
- return;
9074
9073
  let ret;
9075
9074
  const _session = SESSION_OBJ[SESSION_ID];
9076
9075
  let _ds_0 = _session.DS_GLB[0];
@@ -9206,136 +9205,136 @@ func.UI.update_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
9206
9205
  return ret;
9207
9206
  };
9208
9207
 
9209
- func.UI.create_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
9210
- let ret;
9211
- const _session = SESSION_OBJ[SESSION_ID];
9212
- let _ds_0 = _session.DS_GLB[0];
9208
+ // func.UI.create_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
9209
+ // let ret;
9210
+ // const _session = SESSION_OBJ[SESSION_ID];
9211
+ // let _ds_0 = _session.DS_GLB[0];
9213
9212
 
9214
- function createWatchedObject(obj, onChange) {
9215
- const watchers = new WeakMap();
9213
+ // function createWatchedObject(obj, onChange) {
9214
+ // const watchers = new WeakMap();
9216
9215
 
9217
- function createProxy(target, path = []) {
9218
- if (watchers.has(target)) {
9219
- return watchers.get(target);
9220
- }
9221
-
9222
- const proxy = new Proxy(target, {
9223
- set(obj, prop, value) {
9224
- const oldValue = obj[prop];
9225
- let currentPath = [...path, prop];
9216
+ // function createProxy(target, path = []) {
9217
+ // if (watchers.has(target)) {
9218
+ // return watchers.get(target);
9219
+ // }
9226
9220
 
9227
- // Set the new value
9228
- obj[prop] = value;
9221
+ // const proxy = new Proxy(target, {
9222
+ // set(obj, prop, value) {
9223
+ // const oldValue = obj[prop];
9224
+ // let currentPath = [...path, prop];
9229
9225
 
9230
- // If the new value is an object, make it observable too
9231
- if (typeof value === 'object' && value !== null) {
9232
- obj[prop] = createProxy(value, currentPath);
9233
- }
9226
+ // // Set the new value
9227
+ // obj[prop] = value;
9234
9228
 
9235
- // Notify of change
9236
- // if (oldValue !== value) {
9237
- if (!_.isEqual(value, oldValue)) {
9238
- currentPath.shift();
9239
- onChange({
9240
- path: currentPath.join('.'),
9241
- oldValue,
9242
- newValue: value,
9243
- type: 'set',
9244
- timestamp: Date.now(),
9245
- });
9246
- }
9229
+ // // If the new value is an object, make it observable too
9230
+ // if (typeof value === 'object' && value !== null) {
9231
+ // obj[prop] = createProxy(value, currentPath);
9232
+ // }
9247
9233
 
9248
- return true;
9249
- },
9234
+ // // Notify of change
9235
+ // // if (oldValue !== value) {
9236
+ // if (!_.isEqual(value, oldValue)) {
9237
+ // currentPath.shift();
9238
+ // onChange({
9239
+ // path: currentPath.join('.'),
9240
+ // oldValue,
9241
+ // newValue: value,
9242
+ // type: 'set',
9243
+ // timestamp: Date.now(),
9244
+ // });
9245
+ // }
9250
9246
 
9251
- deleteProperty(obj, prop) {
9252
- const oldValue = obj[prop];
9253
- const currentPath = [...path, prop];
9247
+ // return true;
9248
+ // },
9254
9249
 
9255
- delete obj[prop];
9250
+ // deleteProperty(obj, prop) {
9251
+ // const oldValue = obj[prop];
9252
+ // const currentPath = [...path, prop];
9256
9253
 
9257
- onChange({
9258
- path: currentPath.join('.'),
9259
- oldValue,
9260
- newValue: undefined,
9261
- type: 'delete',
9262
- timestamp: Date.now(),
9263
- });
9254
+ // delete obj[prop];
9264
9255
 
9265
- return true;
9266
- },
9267
- });
9256
+ // onChange({
9257
+ // path: currentPath.join('.'),
9258
+ // oldValue,
9259
+ // newValue: undefined,
9260
+ // type: 'delete',
9261
+ // timestamp: Date.now(),
9262
+ // });
9268
9263
 
9269
- // Make nested objects observable
9270
- for (const [key, value] of Object.entries(target)) {
9271
- if (typeof value === 'object' && value !== null) {
9272
- target[key] = createProxy(value, [...path, key]);
9273
- }
9274
- }
9264
+ // return true;
9265
+ // },
9266
+ // });
9275
9267
 
9276
- watchers.set(target, proxy);
9277
- return proxy;
9278
- }
9268
+ // // Make nested objects observable
9269
+ // for (const [key, value] of Object.entries(target)) {
9270
+ // if (typeof value === 'object' && value !== null) {
9271
+ // target[key] = createProxy(value, [...path, key]);
9272
+ // }
9273
+ // }
9279
9274
 
9280
- return createProxy(obj);
9281
- }
9275
+ // watchers.set(target, proxy);
9276
+ // return proxy;
9277
+ // }
9282
9278
 
9283
- let _ds = _session.DS_GLB[dsSessionP];
9279
+ // return createProxy(obj);
9280
+ // }
9284
9281
 
9285
- // const watchedDs = createWatchedObject({ _ref: _ds }, async (change) => {
9286
- // // console.log('Change detected:', change);
9287
- // const { path, newValue, oldValue } = change;
9282
+ // let _ds = _session.DS_GLB[dsSessionP];
9288
9283
 
9289
- // });
9284
+ // // const watchedDs = createWatchedObject({ _ref: _ds }, async (change) => {
9285
+ // // // console.log('Change detected:', change);
9286
+ // // const { path, newValue, oldValue } = change;
9290
9287
 
9291
- const createBasicProxy = (target) => {
9292
- return new Proxy(target, {
9293
- // Intercept property access
9294
- get(obj, prop) {
9295
- console.log(`Getting property: ${String(prop)}`);
9296
- return prop in obj ? obj[prop] : `Property ${String(prop)} not found`;
9297
- },
9288
+ // // });
9298
9289
 
9299
- // Intercept property assignment
9300
- set(obj, prop, value) {
9301
- console.log(`Setting property: ${String(prop)} to ${value}`);
9302
- obj[prop] = value;
9303
- return true; // indicates success
9304
- },
9290
+ // const createBasicProxy = (target) => {
9291
+ // return new Proxy(target, {
9292
+ // // Intercept property access
9293
+ // get(obj, prop) {
9294
+ // console.log(`Getting property: ${String(prop)}`);
9295
+ // return prop in obj ? obj[prop] : `Property ${String(prop)} not found`;
9296
+ // },
9305
9297
 
9306
- // Intercept property deletion
9307
- deleteProperty(obj, prop) {
9308
- console.log(`Deleting property: ${String(prop)}`);
9309
- if (prop in obj) {
9310
- delete obj[prop];
9311
- return true;
9312
- }
9313
- return false;
9314
- },
9315
- });
9316
- };
9298
+ // // Intercept property assignment
9299
+ // set(obj, prop, value) {
9300
+ // console.log(`Setting property: ${String(prop)} to ${value}`);
9301
+ // obj[prop] = value;
9302
+ // return true; // indicates success
9303
+ // },
9317
9304
 
9318
- // let obj = { ds: watchedDs._ref, data: {}, props: _ds.in_parameters || {} };
9319
- let obj = { ds: createBasicProxy(_ds), data: {}, props: _ds.in_parameters || {} };
9320
- try {
9321
- const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
9322
- obj.data = _ds?.data_feed?.rows?.[row_idx];
9323
- } catch (error) {
9324
- // error normal if find_ROWID_idx fail
9325
- }
9305
+ // // Intercept property deletion
9306
+ // deleteProperty(obj, prop) {
9307
+ // console.log(`Deleting property: ${String(prop)}`);
9308
+ // if (prop in obj) {
9309
+ // delete obj[prop];
9310
+ // return true;
9311
+ // }
9312
+ // return false;
9313
+ // },
9314
+ // });
9315
+ // };
9316
+ // const p = createBasicProxy(_ds);
9317
+ // // let obj = { ds: watchedDs._ref, data: {}, props: _ds.in_parameters || {} };
9318
+ // let obj = { ds: {}, data: {}, props: _ds.in_parameters || {} };
9319
+ // try {
9320
+ // const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
9321
+ // obj.data = _ds?.data_feed?.rows?.[row_idx];
9322
+ // } catch (error) {
9323
+ // // error normal if find_ROWID_idx fail
9324
+ // }
9326
9325
 
9327
- let SYS_GLOBAL_OBJ_REFS = _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'];
9326
+ // let SYS_GLOBAL_OBJ_REFS = _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'];
9328
9327
 
9329
- if ($elm) {
9330
- const attributes = $elm?.data()?.xuData?.xuPanelProps || $elm?.data()?.xuData?.debug_info?.attribute_stat || {};
9331
- obj.attributes = attributes;
9332
- obj.xu_ui_id = $elm.attr('xu-ui-id');
9333
- }
9328
+ // if ($elm) {
9329
+ // const attributes = $elm?.data()?.xuData?.xuPanelProps || $elm?.data()?.xuData?.debug_info?.attribute_stat || {};
9330
+ // obj.attributes = attributes;
9331
+ // obj.xu_ui_id = $elm.attr('xu-ui-id');
9332
+ // }
9334
9333
 
9335
- SYS_GLOBAL_OBJ_REFS[ref_field_id] = obj;
9334
+ // SYS_GLOBAL_OBJ_REFS[ref_field_id] = obj;
9336
9335
 
9337
- return ret;
9338
- };
9336
+ // return ret;
9337
+ // };
9339
9338
  func.UI.screen = {};
9340
9339
  func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callingDataSource_objP, $callingContainerP, triggerIdP, rowIdP, jobNoP, is_panelP, parameters_obj_inP, source_functionP, call_screen_propertiesP, refreshed_ds, parameters_raw_obj) {
9341
9340
  if (!prog_id) return console.error('program is empty');