@xuda.io/runtime-bundle 1.0.1413 → 1.0.1414
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 +42 -16
- package/js/xuda-runtime-bundle.min.js +2 -2
- package/js/xuda-runtime-slim.js +42 -16
- package/js/xuda-runtime-slim.min.es.js +42 -16
- package/js/xuda-runtime-slim.min.js +2 -2
- package/js/xuda-server-bundle.min.mjs +1 -1
- package/js/xuda-server-bundle.mjs +16 -3
- package/js/xuda-worker-bundle.js +16 -3
- package/js/xuda-worker-bundle.min.js +1 -1
- package/js/xuda_common-bundle.js +16 -3
- package/js/xuda_common-bundle.min.js +1 -1
- package/package.json +1 -1
|
@@ -24189,7 +24189,7 @@ func.runtime.bind.build_datasource_changes = function (dsSessionP, currentRecord
|
|
|
24189
24189
|
},
|
|
24190
24190
|
};
|
|
24191
24191
|
};
|
|
24192
|
-
func.runtime.bind.resolve_field = async function (SESSION_ID, prog_id, dsSessionP, field_id) {
|
|
24192
|
+
func.runtime.bind.resolve_field = async function (SESSION_ID, prog_id, dsSessionP, field_id, iterate_info) {
|
|
24193
24193
|
let _prog_id = prog_id;
|
|
24194
24194
|
let _dsP = dsSessionP;
|
|
24195
24195
|
let is_dynamic_field = false;
|
|
@@ -24205,7 +24205,20 @@ func.runtime.bind.resolve_field = async function (SESSION_ID, prog_id, dsSession
|
|
|
24205
24205
|
|
|
24206
24206
|
if (['_FOR_VAL', '_FOR_KEY'].includes(field_id)) {
|
|
24207
24207
|
is_dynamic_field = true;
|
|
24208
|
-
|
|
24208
|
+
if (iterate_info && (iterate_info.iterator_val === field_id || iterate_info.iterator_key === field_id)) {
|
|
24209
|
+
const iter_value = iterate_info.iterator_val === field_id ? iterate_info._val : iterate_info._key;
|
|
24210
|
+
const toType = function (obj) {
|
|
24211
|
+
return {}.toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase();
|
|
24212
|
+
};
|
|
24213
|
+
field_prop = {
|
|
24214
|
+
id: field_id,
|
|
24215
|
+
data: { type: 'virtual', field_id },
|
|
24216
|
+
props: { fieldType: typeof iter_value !== 'undefined' ? toType(iter_value) : 'string' },
|
|
24217
|
+
value: iter_value,
|
|
24218
|
+
};
|
|
24219
|
+
} else {
|
|
24220
|
+
field_prop = SESSION_OBJ[SESSION_ID]?.DS_GLB?.[_dsP]?.dynamic_fields?.[field_id];
|
|
24221
|
+
}
|
|
24209
24222
|
} else {
|
|
24210
24223
|
field_prop = await find_in_view(field_id, _prog_id);
|
|
24211
24224
|
if (!field_prop) {
|
|
@@ -24289,7 +24302,7 @@ func.runtime.bind.update_reference_source_array = async function (options) {
|
|
|
24289
24302
|
if (field_type === 'object' && options.val_is_reference_field) {
|
|
24290
24303
|
let obj_item = new_arr[arr_idx];
|
|
24291
24304
|
let e_exp = options.expression_value.replace(options.bind_field_id, 'obj_item');
|
|
24292
|
-
eval(e_exp +
|
|
24305
|
+
eval(e_exp + `=${JSON.stringify(options.value)}`);
|
|
24293
24306
|
new_arr[arr_idx] = obj_item;
|
|
24294
24307
|
} else {
|
|
24295
24308
|
new_arr[arr_idx] = options.value;
|
|
@@ -30317,7 +30330,6 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
|
|
|
30317
30330
|
const perf_end = func.runtime?.perf?.start?.(SESSION_ID, 'execute_xu_render_attributes');
|
|
30318
30331
|
const live_context = fx.get_live_element_context(queue_obj.paramsP?.elem_key, queue_obj.elementP || queue_obj.paramsP?.elem_val?.$elm, queue_obj.paramsP);
|
|
30319
30332
|
const _data = live_context.data;
|
|
30320
|
-
console.log('[xu-render EXEC]', { attr_value: queue_obj.paramsP.attr_value, has_data: !!_data?.xuData?.paramsP, elem_key: queue_obj.paramsP?.elem_key, tagName: live_context.$elm?.[0]?.tagName, elm_length: live_context.$elm?.length });
|
|
30321
30333
|
try {
|
|
30322
30334
|
if (_data?.xuData?.paramsP) {
|
|
30323
30335
|
const live_xu_data = _data.xuData;
|
|
@@ -31257,7 +31269,7 @@ func.runtime.ui.init_screen = async function (options) {
|
|
|
31257
31269
|
$rootFrame.css('display', 'contents');
|
|
31258
31270
|
}
|
|
31259
31271
|
|
|
31260
|
-
func.UI.utils.indicator.screen.busy();
|
|
31272
|
+
if (!is_panelP) func.UI.utils.indicator.screen.busy();
|
|
31261
31273
|
|
|
31262
31274
|
const ret = await func.datasource.create(
|
|
31263
31275
|
SESSION_ID,
|
|
@@ -31273,7 +31285,7 @@ func.runtime.ui.init_screen = async function (options) {
|
|
|
31273
31285
|
null,
|
|
31274
31286
|
null,
|
|
31275
31287
|
null,
|
|
31276
|
-
|
|
31288
|
+
is_panelP,
|
|
31277
31289
|
parameters_obj_inP,
|
|
31278
31290
|
);
|
|
31279
31291
|
|
|
@@ -31300,7 +31312,7 @@ func.runtime.ui.init_screen = async function (options) {
|
|
|
31300
31312
|
if (!node.length) return console.warn('ui node empty');
|
|
31301
31313
|
const ret_render_$container = await func.runtime.render.render_ui_tree(SESSION_ID, $rootFrame, node[0], null, params, jobNoP, null, null, null, null, null, $rootFrame);
|
|
31302
31314
|
|
|
31303
|
-
func.UI.utils.indicator.screen.normal();
|
|
31315
|
+
if (!is_panelP) func.UI.utils.indicator.screen.normal();
|
|
31304
31316
|
|
|
31305
31317
|
return await func.runtime.ui.screen_loading_done({
|
|
31306
31318
|
SESSION_ID,
|
|
@@ -31825,6 +31837,7 @@ func.runtime.render = func.runtime.render || {};
|
|
|
31825
31837
|
// Browser-only panel rendering helpers live here so generic view rendering can stay focused.
|
|
31826
31838
|
|
|
31827
31839
|
func.runtime.ui.render_panel_node = async function (options) {
|
|
31840
|
+
|
|
31828
31841
|
const $wrapper = $('<div>');
|
|
31829
31842
|
const $div = await func.runtime.ui.create_container({
|
|
31830
31843
|
SESSION_ID: options.SESSION_ID,
|
|
@@ -32398,7 +32411,7 @@ func.runtime.ui.normalize_refresh_field_reference = function (field_ref) {
|
|
|
32398
32411
|
|
|
32399
32412
|
return [...normalized].filter(Boolean);
|
|
32400
32413
|
};
|
|
32401
|
-
func.runtime.ui.extract_expression_refresh_fields = function (elm_data, expression_text, without_var) {
|
|
32414
|
+
func.runtime.ui.extract_expression_refresh_fields = function (elm_data, expression_text, without_var, _visited) {
|
|
32402
32415
|
const fields = new Set();
|
|
32403
32416
|
if (!expression_text) {
|
|
32404
32417
|
return fields;
|
|
@@ -32429,8 +32442,12 @@ func.runtime.ui.extract_expression_refresh_fields = function (elm_data, expressi
|
|
|
32429
32442
|
|
|
32430
32443
|
const parameters_raw_obj = elm_data?.xuData?.paramsP?.parameters_raw_obj || {};
|
|
32431
32444
|
const parameter_keys = Object.keys(parameters_raw_obj);
|
|
32445
|
+
const visited = _visited || new Set();
|
|
32432
32446
|
for (let index = 0; index < parameter_keys.length; index++) {
|
|
32433
32447
|
const param_key = parameter_keys[index];
|
|
32448
|
+
if (visited.has(param_key)) {
|
|
32449
|
+
continue;
|
|
32450
|
+
}
|
|
32434
32451
|
const param_val = parameters_raw_obj[param_key];
|
|
32435
32452
|
if (!param_val?.includes?.('@')) {
|
|
32436
32453
|
continue;
|
|
@@ -32439,7 +32456,8 @@ func.runtime.ui.extract_expression_refresh_fields = function (elm_data, expressi
|
|
|
32439
32456
|
if (!text.includes(param_token)) {
|
|
32440
32457
|
continue;
|
|
32441
32458
|
}
|
|
32442
|
-
|
|
32459
|
+
visited.add(param_key);
|
|
32460
|
+
const nested_fields = func.runtime.ui.extract_expression_refresh_fields(elm_data, param_val, false, visited);
|
|
32443
32461
|
nested_fields.forEach(function (field_id) {
|
|
32444
32462
|
add_field(field_id);
|
|
32445
32463
|
});
|
|
@@ -36090,7 +36108,7 @@ func.runtime.render.handle_xu_bind = async function (options) {
|
|
|
36090
36108
|
};
|
|
36091
36109
|
|
|
36092
36110
|
try {
|
|
36093
|
-
const bind_field = await func.runtime.bind.resolve_field(options.SESSION_ID, _prog_id, _dsP, bind_expression.split('.')[0]);
|
|
36111
|
+
const bind_field = await func.runtime.bind.resolve_field(options.SESSION_ID, _prog_id, _dsP, bind_expression.split('.')[0], xuData.iterate_info);
|
|
36094
36112
|
bind_field_id = bind_field.bind_field_id;
|
|
36095
36113
|
field_prop = bind_field.field_prop;
|
|
36096
36114
|
is_dynamic_field = bind_field.is_dynamic_field;
|
|
@@ -36166,11 +36184,16 @@ func.runtime.render.handle_xu_bind = async function (options) {
|
|
|
36166
36184
|
let value;
|
|
36167
36185
|
try {
|
|
36168
36186
|
if (val_is_reference_field) {
|
|
36169
|
-
const
|
|
36170
|
-
if (
|
|
36171
|
-
value =
|
|
36187
|
+
const iter = xuData.iterate_info;
|
|
36188
|
+
if (iter && is_dynamic_field && (iter.iterator_val === bind_field_id || iter.iterator_key === bind_field_id)) {
|
|
36189
|
+
value = iter.iterator_val === bind_field_id ? iter._val : iter._key;
|
|
36172
36190
|
} else {
|
|
36173
|
-
|
|
36191
|
+
const resolved_value = await func.datasource.get_value(options.SESSION_ID, bind_field_id, _dsP, target_record_id);
|
|
36192
|
+
if (resolved_value?.found) {
|
|
36193
|
+
value = resolved_value.ret.value;
|
|
36194
|
+
} else {
|
|
36195
|
+
value = func.runtime.bind.get_source_value(_ds, bind_field_id, is_dynamic_field);
|
|
36196
|
+
}
|
|
36174
36197
|
}
|
|
36175
36198
|
value = func.runtime.bind.format_display_value($elm, field_prop, bind_field_id, bind_expression, value, input_field_type);
|
|
36176
36199
|
} else {
|
|
@@ -36524,7 +36547,11 @@ func.runtime.render.handle_modern_xu_render = async function (options) {
|
|
|
36524
36547
|
};
|
|
36525
36548
|
|
|
36526
36549
|
const post_render = async function () {
|
|
36527
|
-
const
|
|
36550
|
+
const container_data = func.runtime.ui.get_data(options.$container);
|
|
36551
|
+
if (!container_data?.xuData?.node?.children?.[options.keyP]) {
|
|
36552
|
+
return;
|
|
36553
|
+
}
|
|
36554
|
+
const nodeP = container_data.xuData.node.children[options.keyP];
|
|
36528
36555
|
nodeP.xu_render_made = value;
|
|
36529
36556
|
if (value) {
|
|
36530
36557
|
try {
|
|
@@ -36575,7 +36602,6 @@ func.runtime.render.handle_modern_xu_render = async function (options) {
|
|
|
36575
36602
|
func.runtime.ui.remove(options.$elm);
|
|
36576
36603
|
}
|
|
36577
36604
|
} catch (error) {
|
|
36578
|
-
console.error('[xu-render post_render ERROR]', error, { keyP: options.keyP, container_tag: options.$container?.[0]?.tagName, has_node: !!nodeP, xu_ui_id: func.runtime.ui.get_attr(options.$elm, 'xu-ui-id') });
|
|
36579
36605
|
func.events.delete_job(options.SESSION_ID, options.jobNoP);
|
|
36580
36606
|
}
|
|
36581
36607
|
return;
|