@xuda.io/runtime-bundle 1.0.500 → 1.0.502

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.
@@ -31840,7 +31840,7 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
31840
31840
  null,
31841
31841
  null,
31842
31842
  wrapper_data.xuData.key, // the wrapper key
31843
- null,
31843
+ panel_val._ds.dsSession, // the refreshed_ds
31844
31844
  wrapper_data.xuData.parent_node, // the wrapper parent node
31845
31845
  null,
31846
31846
  wrapper_data.xuData.$root_container, // the wrapper root container
@@ -33452,7 +33452,7 @@ func.UI.screen.screen_loading_done = async function (SESSION_ID, paramsP, $div,
33452
33452
  return $div;
33453
33453
  };
33454
33454
 
33455
- func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, parent_infoP, paramsP, jobNoP, is_skeleton, keyP, is_mainP, parent_nodeP, check_existP, $root_container) {
33455
+ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, parent_infoP, paramsP, jobNoP, is_skeleton, keyP, refreshed_ds, parent_nodeP, check_existP, $root_container) {
33456
33456
  if (!is_skeleton) {
33457
33457
  var _session = SESSION_OBJ[SESSION_ID];
33458
33458
  var _ds = _session.DS_GLB[paramsP.dsSessionP];
@@ -34917,7 +34917,7 @@ func.UI.component.init_xu_nav = function ($container, $nav) {
34917
34917
  };
34918
34918
  func.expression = {};
34919
34919
 
34920
- func.expression.get_org = async function (SESSION_ID, valP, dsSessionP, sourceP, rowIdP, sourceActionP, secondPassP, calling_fieldIdP, fieldsP, debug_infoP, iterate_info, js_script_callback, jobNo, api_output_type) {
34920
+ func.expression.get = async function (SESSION_ID, valP, dsSessionP, sourceP, rowIdP, sourceActionP, secondPassP, calling_fieldIdP, fieldsP, debug_infoP, iterate_info, js_script_callback, jobNo, api_output_type) {
34921
34921
  class xu_class {
34922
34922
  async get() {
34923
34923
  var ret;
@@ -35271,160 +35271,6 @@ func.expression.get_org = async function (SESSION_ID, valP, dsSessionP, sourceP,
35271
35271
  return new_class.get();
35272
35272
  };
35273
35273
 
35274
- func.expression.get = async function (SESSION_ID, valP, dsSessionP, sourceP, rowIdP, sourceActionP, secondPassP, calling_fieldIdP, fieldsP = {}, debug_infoP, iterate_info, js_script_callback, jobNo, api_output_type) {
35275
- class xu_class {
35276
- async get() {
35277
- let ret, error, warning, var_error_found;
35278
- const fields = { ...fieldsP };
35279
- const evalJson = (text) => eval(`(${text})`);
35280
-
35281
- // Initial value processing
35282
- ret = valP === null || typeof valP === 'undefined' ? '' : typeof valP === 'boolean' ? (valP ? 'Y' : 'N') : valP.toString();
35283
- ret = ret.replace(/\&/g, '&').replace(func.utils.replace_studio_drive_url(SESSION_ID, ret));
35284
-
35285
- const endResults = () => {
35286
- if (['update', 'javascript'].includes(sourceP) && typeof ret === 'string') {
35287
- for (const [key, val] of Object.entries(fields)) {
35288
- if (typeof val === 'string') ret = ret.replace(`"${val}"`, val.replace(/"/g, ''));
35289
- }
35290
- }
35291
- if (error && SESSION_OBJ[SESSION_ID]?.DS_GLB[dsSessionP]) {
35292
- func.utils.debug.log(SESSION_ID, SESSION_OBJ[SESSION_ID].DS_GLB[dsSessionP].nodeId, {
35293
- module: 'expression',
35294
- action: sourceP,
35295
- source: calling_fieldIdP,
35296
- prop: ret,
35297
- details: ret,
35298
- result: ret,
35299
- error,
35300
- warning,
35301
- fields: null,
35302
- type: 'exp',
35303
- prog_id: SESSION_OBJ[SESSION_ID].DS_GLB[dsSessionP].prog_id,
35304
- debug_info: debug_infoP,
35305
- });
35306
- }
35307
- return { result: ret, fields, error, warning, req: valP, var_error_found };
35308
- };
35309
-
35310
- const handleNonVariable = async () => {
35311
- try {
35312
- if (sourceP !== 'arguments') {
35313
- if (ret.startsWith('_DATE_')) ret = ret.slice(6);
35314
- else if (/^\d{4}-\d{2}-\d{2}$/.test(ret) || ret === 'self') return endResults();
35315
- else ret = await func.expression.secure_eval(SESSION_ID, sourceP, ret, jobNo, dsSessionP, js_script_callback);
35316
- } else {
35317
- ret = ret.replace(/_NULL/gi, '');
35318
- }
35319
- return endResults();
35320
- } catch (err) {
35321
- error = err.message;
35322
- return endResults();
35323
- }
35324
- };
35325
-
35326
- if (!func.expression.validate_variables(valP)) return await handleNonVariable();
35327
- if (glb.emailRegex.test(await func.expression.secure_eval(SESSION_ID, sourceP, valP, jobNo, dsSessionP, js_script_callback))) {
35328
- return await handleNonVariable();
35329
- }
35330
-
35331
- const var_Arr = await Promise.all(
35332
- (func.expression.parse(ret) || []).map(async (val, key) => {
35333
- const result = { value: val.value, fieldId: val.fieldId };
35334
- if (!val.fieldId) return result;
35335
-
35336
- if (val.fieldId.startsWith('_THIS') && calling_fieldIdP) {
35337
- result.fieldId = val.fieldId.length === 5 ? calling_fieldIdP : calling_fieldIdP + val.fieldId.slice(5);
35338
- }
35339
-
35340
- const { ret: fetchedValue, fieldIdP } = await func.datasource.get_value(SESSION_ID, result.fieldId, dsSessionP, rowIdP);
35341
- result.value = fetchedValue?.value ?? (sourceP === 'exp' ? fetchedValue?.value : '""');
35342
- result.type = fetchedValue?.type;
35343
-
35344
- if (iterate_info) {
35345
- if (iterate_info.iterator_key === fieldIdP) result.value = iterate_info._key;
35346
- if (iterate_info.iterator_val === fieldIdP) result.value = iterate_info._val;
35347
- }
35348
-
35349
- if (val.value.includes('[') || val.value.includes('.')) {
35350
- const { property1, property2 } = await func.expression.get_property(val.value);
35351
- const data = fetchedValue?.type === 'object' ? fetchedValue.value : fetchedValue?.prop;
35352
-
35353
- if (key > 0 && val.value.includes(']') && !val.value.includes('[') && var_Arr[key - 1]?.value) {
35354
- const prevData = var_Arr[key - 1].value;
35355
- result.value = prevData[fieldIdP] ?? '';
35356
- if (val.value.includes('.') && prevData[fieldIdP]) result.value = prevData[fieldIdP][property2] ?? '';
35357
- } else if (data) {
35358
- if (property1) result.value = data[property1] ?? '';
35359
- if (property2) result.value = (property1 ? data[property1]?.[property2] : data[property2]) ?? '';
35360
- }
35361
- }
35362
- fields[fieldIdP] = result.value;
35363
- return result;
35364
- }),
35365
- );
35366
-
35367
- try {
35368
- const res = var_Arr.map((val, key) => {
35369
- if (sourceP === 'UI Property EXP' || sourceP === 'UI Attr EXP') {
35370
- const { changed, value } = func.utils.get_drive_url(SESSION_ID, val.value, sourceP === 'UI Property EXP' || var_Arr.length > 1);
35371
- if (changed) return value;
35372
- }
35373
-
35374
- let value = val.value;
35375
- if (var_Arr.length > 1) {
35376
- if (!['DbQuery', 'alert', 'exp', 'api_rendered_output'].includes(sourceP) && ['string', 'date'].includes(val.type)) {
35377
- value = `\`${value}\``;
35378
- } else if (sourceP === 'api_rendered_output' && api_output_type === 'json' && ['string', 'date'].includes(val.type)) {
35379
- value = `"${value}"`;
35380
- }
35381
- }
35382
-
35383
- if (val.fieldId && typeof value === 'string') {
35384
- if (['query', 'condition', 'range', 'sort', 'locate'].includes(sourceP)) value = value.replace(/↵|\r\n|\n|\r/g, '');
35385
- if (['init', 'update', 'virtual'].includes(sourceP)) value = value.replace(/↵|\r\n|\n|\r/g, '\\n');
35386
- if (typeof IS_PROCESS_SERVER !== 'undefined') value = value.replace(/↵|\r\n|\n|\r/g, '<br>');
35387
- fields[val.fieldId] = value;
35388
- }
35389
-
35390
- if (typeof value === 'object' && var_Arr.length > 1) {
35391
- value = Array.isArray(value) || var_Arr[key + 1]?.value?.includes('.') ? JSON.stringify(value) : `(${JSON.stringify(value)})`;
35392
- }
35393
-
35394
- if (val.type !== 'exp' && sourceP !== 'exp' && typeof value === 'string' && value.startsWith('@')) {
35395
- warning = `Error encoding ${value}`;
35396
- var_error_found = true;
35397
- return '0';
35398
- }
35399
- return value;
35400
- });
35401
-
35402
- ret = res.length === 1 ? res[0] : res.join('');
35403
- if (var_Arr.some((v) => v.type === 'exp') && sourceP !== 'exp' && !secondPassP) {
35404
- const exp = await func.expression.get(SESSION_ID, ret, dsSessionP, sourceP, rowIdP, sourceActionP, true, calling_fieldIdP, fields, debug_infoP);
35405
- ret = exp.res?.[0] ?? exp.result;
35406
- Object.assign(fields, exp.fields);
35407
- } else if (!secondPassP && !['arguments', 'api_rendered_output', 'DbQuery'].includes(sourceP)) {
35408
- ret = await func.expression.secure_eval(SESSION_ID, sourceP, ret, jobNo, dsSessionP, js_script_callback);
35409
- } else if (sourceP === 'DbQuery') {
35410
- ret = JSON.stringify(evalJson(ret));
35411
- }
35412
-
35413
- if (typeof ret === 'string' && ret.startsWith('@')) {
35414
- error = 'Error encoding @ var';
35415
- var_error_found = true;
35416
- }
35417
- } catch (err) {
35418
- error = err.message;
35419
- }
35420
-
35421
- return endResults();
35422
- }
35423
- }
35424
-
35425
- return new xu_class().get();
35426
- };
35427
-
35428
35274
  func.expression.get_bad1 = async function (SESSION_ID, valP, dsSessionP, sourceP, rowIdP, sourceActionP, secondPassP, calling_fieldIdP, fieldsP = {}, debug_infoP, iterate_info, js_script_callback, jobNo, api_output_type) {
35429
35275
  const evalJson = (text) => eval(`(${text})`);
35430
35276
  const replaceQuotes = (str) => {