@xuda.io/runtime-bundle 1.0.481 → 1.0.483
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 +170 -104
- package/js/xuda-runtime-bundle.min.js +1 -1
- package/js/xuda-runtime-slim.js +170 -104
- package/js/xuda-runtime-slim.min.es.js +170 -104
- package/js/xuda-runtime-slim.min.js +2 -2
- package/js/xuda-server-bundle.min.mjs +2 -2
- package/js/xuda-server-bundle.mjs +170 -104
- package/js/xuda-worker-bundle.js +170 -104
- package/js/xuda-worker-bundle.min.js +2 -2
- package/package.json +1 -1
|
@@ -30183,6 +30183,15 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
|
|
|
30183
30183
|
}
|
|
30184
30184
|
};
|
|
30185
30185
|
|
|
30186
|
+
const update_xu_ref = async function () {
|
|
30187
|
+
let _ds_0 = _session.DS_GLB[0];
|
|
30188
|
+
for ([ref_name, val] of Object.entries(_ds_0.data_system['SYS_GLOBAL_OBJ_REFS'])) {
|
|
30189
|
+
if (val.ds.dsSession == dataSource) {
|
|
30190
|
+
func.UI.update_xu_ref(SESSION_ID, dataSource, ref_name);
|
|
30191
|
+
}
|
|
30192
|
+
}
|
|
30193
|
+
};
|
|
30194
|
+
|
|
30186
30195
|
var fields_changed = [];
|
|
30187
30196
|
var datasource_changed = [];
|
|
30188
30197
|
let client_datasource_changes = {};
|
|
@@ -30200,6 +30209,7 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
|
|
|
30200
30209
|
// mechanism to make update directly on the datasource object
|
|
30201
30210
|
if (record_id === 'datasource_main') {
|
|
30202
30211
|
_.set(_ds, field_id, value);
|
|
30212
|
+
update_xu_ref();
|
|
30203
30213
|
continue;
|
|
30204
30214
|
}
|
|
30205
30215
|
|
|
@@ -30217,15 +30227,16 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
|
|
|
30217
30227
|
await set_fieldComputed_dependencies(dataSource, field_id, null);
|
|
30218
30228
|
|
|
30219
30229
|
// search the field in refs
|
|
30220
|
-
|
|
30221
|
-
|
|
30222
|
-
|
|
30223
|
-
|
|
30224
|
-
|
|
30225
|
-
|
|
30226
|
-
|
|
30227
|
-
|
|
30228
|
-
}
|
|
30230
|
+
update_xu_ref();
|
|
30231
|
+
// let _ds_0 = _session.DS_GLB[0];
|
|
30232
|
+
// for ([ref_name, val] of Object.entries(_ds_0.data_system['SYS_GLOBAL_OBJ_REFS'])) {
|
|
30233
|
+
// if (val.ds.dsSession == dataSource) {
|
|
30234
|
+
// func.UI.update_xu_ref(SESSION_ID, dataSource, ref_name);
|
|
30235
|
+
// // if (!fields_changed.includes(ref_name)) {
|
|
30236
|
+
// // fields_changed.push(ref_name);
|
|
30237
|
+
// // }
|
|
30238
|
+
// }
|
|
30239
|
+
// }
|
|
30229
30240
|
|
|
30230
30241
|
if (!update_local_scope_only) {
|
|
30231
30242
|
let tree_ret = await func.utils.TREE_OBJ.get(SESSION_ID, _ds.prog_id);
|
|
@@ -35248,102 +35259,102 @@ func.expression.get = async function (SESSION_ID, valP, dsSessionP, sourceP, row
|
|
|
35248
35259
|
return new_class.get();
|
|
35249
35260
|
};
|
|
35250
35261
|
|
|
35251
|
-
|
|
35252
|
-
|
|
35253
|
-
|
|
35254
|
-
|
|
35255
|
-
|
|
35256
|
-
|
|
35257
|
-
|
|
35258
|
-
|
|
35259
|
-
|
|
35260
|
-
|
|
35261
|
-
|
|
35262
|
-
|
|
35263
|
-
|
|
35264
|
-
|
|
35265
|
-
|
|
35266
|
-
|
|
35267
|
-
|
|
35268
|
-
|
|
35269
|
-
|
|
35270
|
-
|
|
35271
|
-
|
|
35272
|
-
//
|
|
35273
|
-
|
|
35274
|
-
|
|
35275
|
-
|
|
35276
|
-
|
|
35277
|
-
|
|
35278
|
-
|
|
35279
|
-
//
|
|
35280
|
-
|
|
35281
|
-
|
|
35282
|
-
|
|
35283
|
-
|
|
35284
|
-
|
|
35285
|
-
|
|
35286
|
-
|
|
35287
|
-
|
|
35288
|
-
|
|
35289
|
-
|
|
35290
|
-
|
|
35291
|
-
|
|
35292
|
-
|
|
35293
|
-
|
|
35294
|
-
|
|
35295
|
-
//
|
|
35296
|
-
|
|
35297
|
-
//
|
|
35298
|
-
//
|
|
35299
|
-
|
|
35300
|
-
//
|
|
35301
|
-
|
|
35302
|
-
|
|
35303
|
-
|
|
35304
|
-
|
|
35305
|
-
|
|
35306
|
-
|
|
35307
|
-
|
|
35308
|
-
|
|
35309
|
-
|
|
35310
|
-
//
|
|
35311
|
-
|
|
35312
|
-
|
|
35313
|
-
|
|
35314
|
-
|
|
35315
|
-
//
|
|
35316
|
-
|
|
35317
|
-
|
|
35318
|
-
|
|
35319
|
-
|
|
35320
|
-
|
|
35321
|
-
//
|
|
35322
|
-
//
|
|
35323
|
-
//
|
|
35324
|
-
|
|
35325
|
-
|
|
35326
|
-
|
|
35327
|
-
|
|
35328
|
-
|
|
35329
|
-
|
|
35330
|
-
|
|
35331
|
-
|
|
35332
|
-
|
|
35333
|
-
|
|
35334
|
-
|
|
35335
|
-
|
|
35336
|
-
|
|
35337
|
-
|
|
35338
|
-
|
|
35339
|
-
|
|
35340
|
-
|
|
35341
|
-
|
|
35342
|
-
|
|
35343
|
-
|
|
35344
|
-
|
|
35262
|
+
func.expression.parse_org = function (strP) {
|
|
35263
|
+
var extract_str = function (strP, posP) {
|
|
35264
|
+
if (!posP) posP = 0;
|
|
35265
|
+
var clean_split_str = function (arrP) {
|
|
35266
|
+
var arr = [];
|
|
35267
|
+
if (arrP && arrP.length > 1 && arrP[0] === '' && arrP[1].indexOf('@') > -1) {
|
|
35268
|
+
for (var i = 1; i <= arrP.length; i++) {
|
|
35269
|
+
arr.push(arrP[i]);
|
|
35270
|
+
}
|
|
35271
|
+
return arr;
|
|
35272
|
+
} else return arrP;
|
|
35273
|
+
};
|
|
35274
|
+
var nonLettersPatt = /\W/; // non letters
|
|
35275
|
+
var validSymbolsNoArray = /[^.@\[]/; //valid symbols no array /[^.@\[\]\]]/
|
|
35276
|
+
var validSymbolsWithArray = /[^.@"'\[\]]/; //valid symbols with array
|
|
35277
|
+
var validSymbols = validSymbolsNoArray;
|
|
35278
|
+
var splitTmp = strP.replace(/@/g, '^^@').split('^^');
|
|
35279
|
+
var split = clean_split_str(splitTmp);
|
|
35280
|
+
var obj = [];
|
|
35281
|
+
if (split) {
|
|
35282
|
+
for (let val of split) {
|
|
35283
|
+
// run on @ segments
|
|
35284
|
+
if (val) {
|
|
35285
|
+
var pos = strP.indexOf(val);
|
|
35286
|
+
if (val && val.substr(0, 1) === '@') {
|
|
35287
|
+
var tmpStr = '';
|
|
35288
|
+
var word_start_pos = undefined;
|
|
35289
|
+
var word_end_pos = undefined;
|
|
35290
|
+
// run on @ segment string
|
|
35291
|
+
for (var i = 0; i <= val.length; i++) {
|
|
35292
|
+
var key1 = i;
|
|
35293
|
+
var val1 = val.substr(i, 1);
|
|
35294
|
+
if (
|
|
35295
|
+
val1 === '.' &&
|
|
35296
|
+
!word_start_pos // find first dot
|
|
35297
|
+
)
|
|
35298
|
+
word_start_pos = key1;
|
|
35299
|
+
if (
|
|
35300
|
+
word_start_pos &&
|
|
35301
|
+
key1 > word_start_pos &&
|
|
35302
|
+
nonLettersPatt.test(val1) // find any sign character to mark the end of word
|
|
35303
|
+
)
|
|
35304
|
+
word_end_pos = key1;
|
|
35305
|
+
if (word_start_pos && word_start_pos >= 0 && word_end_pos && word_end_pos >= 0) {
|
|
35306
|
+
// find the word
|
|
35307
|
+
var word = val.substr(word_start_pos + 1, word_end_pos - word_start_pos - 1); // get the word
|
|
35308
|
+
// if (glb.ALL_PROPERTIES_ARR.indexOf(word) === -1) {
|
|
35309
|
+
// compare with internal properties
|
|
35310
|
+
tmpStr = tmpStr.substr(0, word_start_pos) + '^^' + tmpStr.substr(word_start_pos, word_end_pos);
|
|
35311
|
+
// }
|
|
35312
|
+
if (val.substr(word_end_pos, 1) === '.') word_start_pos = word_end_pos;
|
|
35313
|
+
else word_start_pos = null;
|
|
35314
|
+
word_end_pos = null;
|
|
35315
|
+
}
|
|
35316
|
+
if (val1 === '[') validSymbols = validSymbolsWithArray;
|
|
35317
|
+
if (nonLettersPatt.test(val1) && validSymbols.test(val1) && tmpStr.indexOf('^^') === -1) {
|
|
35318
|
+
tmpStr += '^^' + val1;
|
|
35319
|
+
} else tmpStr += val1;
|
|
35320
|
+
}
|
|
35321
|
+
// });
|
|
35322
|
+
if (tmpStr.indexOf('^^') > -1) {
|
|
35323
|
+
var obj1 = extract_str(tmpStr, pos);
|
|
35324
|
+
obj = obj.concat(obj1);
|
|
35325
|
+
} else {
|
|
35326
|
+
// push clean @var
|
|
35327
|
+
var fieldId = undefined;
|
|
35328
|
+
if (val) {
|
|
35329
|
+
fieldId = val.substr(1, val.length);
|
|
35330
|
+
if (val.indexOf('.') > -1) fieldId = val.substr(1, val.indexOf('.') - 1);
|
|
35331
|
+
if (val.indexOf('[') > -1) fieldId = val.substr(1, val.indexOf('[') - 1);
|
|
35332
|
+
//
|
|
35333
|
+
// if (val.indexOf("]") > -1)
|
|
35334
|
+
// fieldId = val.substr(1, val.indexOf("]") - 1);
|
|
35335
|
+
}
|
|
35336
|
+
obj.push({
|
|
35337
|
+
value: val,
|
|
35338
|
+
fieldId: fieldId,
|
|
35339
|
+
pos: pos + posP,
|
|
35340
|
+
});
|
|
35341
|
+
}
|
|
35342
|
+
} else {
|
|
35343
|
+
obj.push({
|
|
35344
|
+
value: val,
|
|
35345
|
+
pos: pos + posP,
|
|
35346
|
+
});
|
|
35347
|
+
}
|
|
35348
|
+
}
|
|
35349
|
+
}
|
|
35350
|
+
return obj;
|
|
35351
|
+
}
|
|
35352
|
+
};
|
|
35353
|
+
var res = extract_str(strP);
|
|
35354
|
+
return res;
|
|
35355
|
+
};
|
|
35345
35356
|
|
|
35346
|
-
func.expression.
|
|
35357
|
+
func.expression.parse_bad = function (strP) {
|
|
35347
35358
|
const nonLettersPatt = /\W/;
|
|
35348
35359
|
const validSymbolsNoArray = /[^.@\[]/;
|
|
35349
35360
|
const validSymbolsWithArray = /[^.@"'\[\]]/;
|
|
@@ -35401,6 +35412,61 @@ func.expression.parse = function (strP) {
|
|
|
35401
35412
|
return extractStr(strP);
|
|
35402
35413
|
};
|
|
35403
35414
|
|
|
35415
|
+
func.expression.parse = function (input) {
|
|
35416
|
+
if (typeof input !== 'string') return [];
|
|
35417
|
+
|
|
35418
|
+
const segments = [];
|
|
35419
|
+
let pos = 0;
|
|
35420
|
+
|
|
35421
|
+
const parts = input.split(/(@)/).filter(Boolean);
|
|
35422
|
+
|
|
35423
|
+
for (let i = 0; i < parts.length; i++) {
|
|
35424
|
+
const part = parts[i];
|
|
35425
|
+
|
|
35426
|
+
if (part === '@' && i + 1 < parts.length) {
|
|
35427
|
+
const nextPart = parts[i + 1];
|
|
35428
|
+
const varEnd = nextPart.search(/[.\[]/); // Split at first . or [
|
|
35429
|
+
let fieldId, remainder;
|
|
35430
|
+
|
|
35431
|
+
if (varEnd > 0) {
|
|
35432
|
+
fieldId = nextPart.slice(0, varEnd);
|
|
35433
|
+
remainder = nextPart.slice(varEnd);
|
|
35434
|
+
} else {
|
|
35435
|
+
fieldId = nextPart;
|
|
35436
|
+
remainder = '';
|
|
35437
|
+
}
|
|
35438
|
+
|
|
35439
|
+
// Add @variable segment
|
|
35440
|
+
const fullVarValue = `@${fieldId}`;
|
|
35441
|
+
segments.push({
|
|
35442
|
+
value: fullVarValue,
|
|
35443
|
+
fieldId,
|
|
35444
|
+
pos,
|
|
35445
|
+
});
|
|
35446
|
+
pos += fullVarValue.length;
|
|
35447
|
+
|
|
35448
|
+
// Add remainder as a separate segment, if any
|
|
35449
|
+
if (remainder) {
|
|
35450
|
+
segments.push({
|
|
35451
|
+
value: remainder,
|
|
35452
|
+
pos,
|
|
35453
|
+
});
|
|
35454
|
+
pos += remainder.length;
|
|
35455
|
+
}
|
|
35456
|
+
|
|
35457
|
+
i++; // Skip the next part since we consumed it
|
|
35458
|
+
} else if (part !== '@') {
|
|
35459
|
+
segments.push({
|
|
35460
|
+
value: part,
|
|
35461
|
+
pos,
|
|
35462
|
+
});
|
|
35463
|
+
pos += part.length;
|
|
35464
|
+
}
|
|
35465
|
+
}
|
|
35466
|
+
|
|
35467
|
+
return segments;
|
|
35468
|
+
};
|
|
35469
|
+
|
|
35404
35470
|
func.expression.get_property = async function (valP) {
|
|
35405
35471
|
async function secure_eval(val) {
|
|
35406
35472
|
if (typeof IS_PROCESS_SERVER === 'undefined') {
|