@xuda.io/runtime-bundle 1.0.1424 → 1.0.1426
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 +141 -47
- package/js/xuda-runtime-bundle.min.js +1 -1
- package/js/xuda-runtime-slim.js +141 -47
- package/js/xuda-runtime-slim.min.es.js +141 -47
- package/js/xuda-runtime-slim.min.js +2 -2
- package/js/xuda-server-bundle.min.mjs +1 -1
- package/js/xuda-server-bundle.mjs +136 -43
- package/js/xuda-worker-bundle.js +136 -43
- package/js/xuda-worker-bundle.min.js +1 -1
- package/package.json +1 -1
package/js/xuda-runtime-slim.js
CHANGED
|
@@ -6225,56 +6225,149 @@ func.datasource.get_viewFields_for_update_function = function (SESSION_ID, calli
|
|
|
6225
6225
|
if (!exp) {
|
|
6226
6226
|
return viewFields;
|
|
6227
6227
|
}
|
|
6228
|
-
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6228
|
+
const trim_wrapping_braces = function (value) {
|
|
6229
|
+
const trimmed = value.trim();
|
|
6230
|
+
if (trimmed.startsWith('{') && trimmed.endsWith('}')) {
|
|
6231
|
+
return trimmed.substring(1, trimmed.length - 1);
|
|
6232
|
+
}
|
|
6233
|
+
return trimmed;
|
|
6234
|
+
};
|
|
6235
|
+
const strip_wrapping_quotes = function (value) {
|
|
6236
|
+
const trimmed = value.trim();
|
|
6237
|
+
const first = trimmed.substring(0, 1);
|
|
6238
|
+
const last = trimmed.substring(trimmed.length - 1);
|
|
6239
|
+
if ((first === "'" || first === '"' || first === '`') && last === first) {
|
|
6240
|
+
return trimmed.substring(1, trimmed.length - 1);
|
|
6241
|
+
}
|
|
6242
|
+
return trimmed;
|
|
6243
|
+
};
|
|
6244
|
+
const split_top_level = function (value) {
|
|
6245
|
+
const parts = [];
|
|
6246
|
+
let current = '';
|
|
6247
|
+
let quote = null;
|
|
6248
|
+
let escape = false;
|
|
6249
|
+
let paren_depth = 0;
|
|
6250
|
+
let bracket_depth = 0;
|
|
6251
|
+
let brace_depth = 0;
|
|
6252
|
+
|
|
6253
|
+
for (let index = 0; index < value.length; index++) {
|
|
6254
|
+
const char = value[index];
|
|
6255
|
+
|
|
6256
|
+
if (escape) {
|
|
6257
|
+
current += char;
|
|
6258
|
+
escape = false;
|
|
6259
|
+
continue;
|
|
6260
|
+
}
|
|
6261
|
+
|
|
6262
|
+
if (quote) {
|
|
6263
|
+
current += char;
|
|
6264
|
+
if (char === '\\') {
|
|
6265
|
+
escape = true;
|
|
6266
|
+
} else if (char === quote) {
|
|
6267
|
+
quote = null;
|
|
6268
|
+
}
|
|
6269
|
+
continue;
|
|
6270
|
+
}
|
|
6271
|
+
|
|
6272
|
+
if (char === "'" || char === '"' || char === '`') {
|
|
6273
|
+
quote = char;
|
|
6274
|
+
current += char;
|
|
6275
|
+
continue;
|
|
6276
|
+
}
|
|
6277
|
+
|
|
6278
|
+
if (char === '(') paren_depth++;
|
|
6279
|
+
if (char === ')') paren_depth = Math.max(0, paren_depth - 1);
|
|
6280
|
+
if (char === '[') bracket_depth++;
|
|
6281
|
+
if (char === ']') bracket_depth = Math.max(0, bracket_depth - 1);
|
|
6282
|
+
if (char === '{') brace_depth++;
|
|
6283
|
+
if (char === '}') brace_depth = Math.max(0, brace_depth - 1);
|
|
6284
|
+
|
|
6285
|
+
if ((char === ',' || char === ';') && !paren_depth && !bracket_depth && !brace_depth) {
|
|
6286
|
+
if (current.trim()) {
|
|
6287
|
+
parts.push(current.trim());
|
|
6288
|
+
}
|
|
6289
|
+
current = '';
|
|
6290
|
+
continue;
|
|
6291
|
+
}
|
|
6292
|
+
|
|
6293
|
+
current += char;
|
|
6238
6294
|
}
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
|
|
6242
|
-
return;
|
|
6295
|
+
|
|
6296
|
+
if (current.trim()) {
|
|
6297
|
+
parts.push(current.trim());
|
|
6243
6298
|
}
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
source: _ds.viewSourceDesc,
|
|
6268
|
-
json: '',
|
|
6269
|
-
fields: '',
|
|
6270
|
-
dsSession: dsSessionP,
|
|
6271
|
-
});
|
|
6299
|
+
|
|
6300
|
+
return parts;
|
|
6301
|
+
};
|
|
6302
|
+
const find_top_level_colon = function (value) {
|
|
6303
|
+
let quote = null;
|
|
6304
|
+
let escape = false;
|
|
6305
|
+
let paren_depth = 0;
|
|
6306
|
+
let bracket_depth = 0;
|
|
6307
|
+
let brace_depth = 0;
|
|
6308
|
+
|
|
6309
|
+
for (let index = 0; index < value.length; index++) {
|
|
6310
|
+
const char = value[index];
|
|
6311
|
+
|
|
6312
|
+
if (escape) {
|
|
6313
|
+
escape = false;
|
|
6314
|
+
continue;
|
|
6315
|
+
}
|
|
6316
|
+
|
|
6317
|
+
if (quote) {
|
|
6318
|
+
if (char === '\\') {
|
|
6319
|
+
escape = true;
|
|
6320
|
+
} else if (char === quote) {
|
|
6321
|
+
quote = null;
|
|
6272
6322
|
}
|
|
6323
|
+
continue;
|
|
6324
|
+
}
|
|
6325
|
+
|
|
6326
|
+
if (char === "'" || char === '"' || char === '`') {
|
|
6327
|
+
quote = char;
|
|
6328
|
+
continue;
|
|
6329
|
+
}
|
|
6330
|
+
|
|
6331
|
+
if (char === '(') paren_depth++;
|
|
6332
|
+
if (char === ')') paren_depth = Math.max(0, paren_depth - 1);
|
|
6333
|
+
if (char === '[') bracket_depth++;
|
|
6334
|
+
if (char === ']') bracket_depth = Math.max(0, bracket_depth - 1);
|
|
6335
|
+
if (char === '{') brace_depth++;
|
|
6336
|
+
if (char === '}') brace_depth = Math.max(0, brace_depth - 1);
|
|
6337
|
+
|
|
6338
|
+
if (char === ':' && !paren_depth && !bracket_depth && !brace_depth) {
|
|
6339
|
+
return index;
|
|
6273
6340
|
}
|
|
6274
6341
|
}
|
|
6275
6342
|
|
|
6276
|
-
return
|
|
6343
|
+
return -1;
|
|
6344
|
+
};
|
|
6345
|
+
|
|
6346
|
+
exp = trim_wrapping_braces(exp.replace(/\n/gi, ''));
|
|
6347
|
+
const exp_arr = split_top_level(exp);
|
|
6348
|
+
for (let index = 0; index < exp_arr.length; index++) {
|
|
6349
|
+
const segment = exp_arr[index];
|
|
6350
|
+
const pos = find_top_level_colon(segment);
|
|
6351
|
+
if (pos === -1) {
|
|
6352
|
+
continue;
|
|
6353
|
+
}
|
|
6354
|
+
|
|
6355
|
+
let id = strip_wrapping_quotes(segment.substring(0, pos));
|
|
6356
|
+
const val = segment.substring(pos + 1).trim();
|
|
6357
|
+
if (id.substring(0, 1) === '@') {
|
|
6358
|
+
id = id.substring(1);
|
|
6359
|
+
}
|
|
6360
|
+
if (!id || !val) {
|
|
6361
|
+
continue;
|
|
6362
|
+
}
|
|
6363
|
+
|
|
6364
|
+
viewFields.push({
|
|
6365
|
+
id,
|
|
6366
|
+
val,
|
|
6367
|
+
});
|
|
6277
6368
|
}
|
|
6369
|
+
|
|
6370
|
+
return viewFields;
|
|
6278
6371
|
};
|
|
6279
6372
|
func.datasource.get_value = async function (SESSION_ID, fieldIdP, dsSessionP, rowIdP, org_dsSessionP) {
|
|
6280
6373
|
const return_value = async (field_id, value) => {
|
|
@@ -16053,10 +16146,11 @@ func.runtime.render.bind_xu_event = function (options) {
|
|
|
16053
16146
|
evt[val.event_modifiers]();
|
|
16054
16147
|
}
|
|
16055
16148
|
|
|
16056
|
-
|
|
16057
|
-
|
|
16149
|
+
const workflow = val.workflow || val.event;
|
|
16150
|
+
if (workflow) {
|
|
16151
|
+
const workflow_keys = Object.keys(workflow);
|
|
16058
16152
|
for (let workflow_index = 0; workflow_index < workflow_keys.length; workflow_index++) {
|
|
16059
|
-
const val2 =
|
|
16153
|
+
const val2 = workflow[workflow_keys[workflow_index]];
|
|
16060
16154
|
if (!val2.data.enabled) continue;
|
|
16061
16155
|
|
|
16062
16156
|
func.events.add_to_queue(
|
|
@@ -16768,7 +16862,7 @@ func.runtime.render.normalize_node_attributes = function (nodeP) {
|
|
|
16768
16862
|
{
|
|
16769
16863
|
handler: 'custom',
|
|
16770
16864
|
props: {},
|
|
16771
|
-
|
|
16865
|
+
workflow: [
|
|
16772
16866
|
{
|
|
16773
16867
|
id: Date.now(),
|
|
16774
16868
|
data: {
|
|
@@ -6151,56 +6151,149 @@ func.datasource.get_viewFields_for_update_function = function (SESSION_ID, calli
|
|
|
6151
6151
|
if (!exp) {
|
|
6152
6152
|
return viewFields;
|
|
6153
6153
|
}
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
|
|
6154
|
+
const trim_wrapping_braces = function (value) {
|
|
6155
|
+
const trimmed = value.trim();
|
|
6156
|
+
if (trimmed.startsWith('{') && trimmed.endsWith('}')) {
|
|
6157
|
+
return trimmed.substring(1, trimmed.length - 1);
|
|
6158
|
+
}
|
|
6159
|
+
return trimmed;
|
|
6160
|
+
};
|
|
6161
|
+
const strip_wrapping_quotes = function (value) {
|
|
6162
|
+
const trimmed = value.trim();
|
|
6163
|
+
const first = trimmed.substring(0, 1);
|
|
6164
|
+
const last = trimmed.substring(trimmed.length - 1);
|
|
6165
|
+
if ((first === "'" || first === '"' || first === '`') && last === first) {
|
|
6166
|
+
return trimmed.substring(1, trimmed.length - 1);
|
|
6167
|
+
}
|
|
6168
|
+
return trimmed;
|
|
6169
|
+
};
|
|
6170
|
+
const split_top_level = function (value) {
|
|
6171
|
+
const parts = [];
|
|
6172
|
+
let current = '';
|
|
6173
|
+
let quote = null;
|
|
6174
|
+
let escape = false;
|
|
6175
|
+
let paren_depth = 0;
|
|
6176
|
+
let bracket_depth = 0;
|
|
6177
|
+
let brace_depth = 0;
|
|
6178
|
+
|
|
6179
|
+
for (let index = 0; index < value.length; index++) {
|
|
6180
|
+
const char = value[index];
|
|
6181
|
+
|
|
6182
|
+
if (escape) {
|
|
6183
|
+
current += char;
|
|
6184
|
+
escape = false;
|
|
6185
|
+
continue;
|
|
6186
|
+
}
|
|
6187
|
+
|
|
6188
|
+
if (quote) {
|
|
6189
|
+
current += char;
|
|
6190
|
+
if (char === '\\') {
|
|
6191
|
+
escape = true;
|
|
6192
|
+
} else if (char === quote) {
|
|
6193
|
+
quote = null;
|
|
6194
|
+
}
|
|
6195
|
+
continue;
|
|
6196
|
+
}
|
|
6197
|
+
|
|
6198
|
+
if (char === "'" || char === '"' || char === '`') {
|
|
6199
|
+
quote = char;
|
|
6200
|
+
current += char;
|
|
6201
|
+
continue;
|
|
6202
|
+
}
|
|
6203
|
+
|
|
6204
|
+
if (char === '(') paren_depth++;
|
|
6205
|
+
if (char === ')') paren_depth = Math.max(0, paren_depth - 1);
|
|
6206
|
+
if (char === '[') bracket_depth++;
|
|
6207
|
+
if (char === ']') bracket_depth = Math.max(0, bracket_depth - 1);
|
|
6208
|
+
if (char === '{') brace_depth++;
|
|
6209
|
+
if (char === '}') brace_depth = Math.max(0, brace_depth - 1);
|
|
6210
|
+
|
|
6211
|
+
if ((char === ',' || char === ';') && !paren_depth && !bracket_depth && !brace_depth) {
|
|
6212
|
+
if (current.trim()) {
|
|
6213
|
+
parts.push(current.trim());
|
|
6214
|
+
}
|
|
6215
|
+
current = '';
|
|
6216
|
+
continue;
|
|
6217
|
+
}
|
|
6218
|
+
|
|
6219
|
+
current += char;
|
|
6164
6220
|
}
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
return;
|
|
6221
|
+
|
|
6222
|
+
if (current.trim()) {
|
|
6223
|
+
parts.push(current.trim());
|
|
6169
6224
|
}
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
|
|
6189
|
-
|
|
6190
|
-
|
|
6191
|
-
|
|
6192
|
-
|
|
6193
|
-
source: _ds.viewSourceDesc,
|
|
6194
|
-
json: '',
|
|
6195
|
-
fields: '',
|
|
6196
|
-
dsSession: dsSessionP,
|
|
6197
|
-
});
|
|
6225
|
+
|
|
6226
|
+
return parts;
|
|
6227
|
+
};
|
|
6228
|
+
const find_top_level_colon = function (value) {
|
|
6229
|
+
let quote = null;
|
|
6230
|
+
let escape = false;
|
|
6231
|
+
let paren_depth = 0;
|
|
6232
|
+
let bracket_depth = 0;
|
|
6233
|
+
let brace_depth = 0;
|
|
6234
|
+
|
|
6235
|
+
for (let index = 0; index < value.length; index++) {
|
|
6236
|
+
const char = value[index];
|
|
6237
|
+
|
|
6238
|
+
if (escape) {
|
|
6239
|
+
escape = false;
|
|
6240
|
+
continue;
|
|
6241
|
+
}
|
|
6242
|
+
|
|
6243
|
+
if (quote) {
|
|
6244
|
+
if (char === '\\') {
|
|
6245
|
+
escape = true;
|
|
6246
|
+
} else if (char === quote) {
|
|
6247
|
+
quote = null;
|
|
6198
6248
|
}
|
|
6249
|
+
continue;
|
|
6250
|
+
}
|
|
6251
|
+
|
|
6252
|
+
if (char === "'" || char === '"' || char === '`') {
|
|
6253
|
+
quote = char;
|
|
6254
|
+
continue;
|
|
6255
|
+
}
|
|
6256
|
+
|
|
6257
|
+
if (char === '(') paren_depth++;
|
|
6258
|
+
if (char === ')') paren_depth = Math.max(0, paren_depth - 1);
|
|
6259
|
+
if (char === '[') bracket_depth++;
|
|
6260
|
+
if (char === ']') bracket_depth = Math.max(0, bracket_depth - 1);
|
|
6261
|
+
if (char === '{') brace_depth++;
|
|
6262
|
+
if (char === '}') brace_depth = Math.max(0, brace_depth - 1);
|
|
6263
|
+
|
|
6264
|
+
if (char === ':' && !paren_depth && !bracket_depth && !brace_depth) {
|
|
6265
|
+
return index;
|
|
6199
6266
|
}
|
|
6200
6267
|
}
|
|
6201
6268
|
|
|
6202
|
-
return
|
|
6269
|
+
return -1;
|
|
6270
|
+
};
|
|
6271
|
+
|
|
6272
|
+
exp = trim_wrapping_braces(exp.replace(/\n/gi, ''));
|
|
6273
|
+
const exp_arr = split_top_level(exp);
|
|
6274
|
+
for (let index = 0; index < exp_arr.length; index++) {
|
|
6275
|
+
const segment = exp_arr[index];
|
|
6276
|
+
const pos = find_top_level_colon(segment);
|
|
6277
|
+
if (pos === -1) {
|
|
6278
|
+
continue;
|
|
6279
|
+
}
|
|
6280
|
+
|
|
6281
|
+
let id = strip_wrapping_quotes(segment.substring(0, pos));
|
|
6282
|
+
const val = segment.substring(pos + 1).trim();
|
|
6283
|
+
if (id.substring(0, 1) === '@') {
|
|
6284
|
+
id = id.substring(1);
|
|
6285
|
+
}
|
|
6286
|
+
if (!id || !val) {
|
|
6287
|
+
continue;
|
|
6288
|
+
}
|
|
6289
|
+
|
|
6290
|
+
viewFields.push({
|
|
6291
|
+
id,
|
|
6292
|
+
val,
|
|
6293
|
+
});
|
|
6203
6294
|
}
|
|
6295
|
+
|
|
6296
|
+
return viewFields;
|
|
6204
6297
|
};
|
|
6205
6298
|
func.datasource.get_value = async function (SESSION_ID, fieldIdP, dsSessionP, rowIdP, org_dsSessionP) {
|
|
6206
6299
|
const return_value = async (field_id, value) => {
|
|
@@ -15979,10 +16072,11 @@ func.runtime.render.bind_xu_event = function (options) {
|
|
|
15979
16072
|
evt[val.event_modifiers]();
|
|
15980
16073
|
}
|
|
15981
16074
|
|
|
15982
|
-
|
|
15983
|
-
|
|
16075
|
+
const workflow = val.workflow || val.event;
|
|
16076
|
+
if (workflow) {
|
|
16077
|
+
const workflow_keys = Object.keys(workflow);
|
|
15984
16078
|
for (let workflow_index = 0; workflow_index < workflow_keys.length; workflow_index++) {
|
|
15985
|
-
const val2 =
|
|
16079
|
+
const val2 = workflow[workflow_keys[workflow_index]];
|
|
15986
16080
|
if (!val2.data.enabled) continue;
|
|
15987
16081
|
|
|
15988
16082
|
func.events.add_to_queue(
|
|
@@ -16694,7 +16788,7 @@ func.runtime.render.normalize_node_attributes = function (nodeP) {
|
|
|
16694
16788
|
{
|
|
16695
16789
|
handler: 'custom',
|
|
16696
16790
|
props: {},
|
|
16697
|
-
|
|
16791
|
+
workflow: [
|
|
16698
16792
|
{
|
|
16699
16793
|
id: Date.now(),
|
|
16700
16794
|
data: {
|