@xuda.io/runtime-bundle 1.0.1420 → 1.0.1422
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 +21 -27
- package/js/xuda-runtime-bundle.min.js +2 -2
- package/js/xuda-runtime-slim.js +21 -27
- package/js/xuda-runtime-slim.min.es.js +21 -27
- package/js/xuda-runtime-slim.min.js +2 -2
- package/js/xuda-server-bundle.min.mjs +1 -1
- package/js/xuda-server-bundle.mjs +11 -4
- package/js/xuda-worker-bundle.js +11 -4
- package/js/xuda-worker-bundle.min.js +1 -1
- package/js/xuda_common-bundle.js +11 -4
- package/js/xuda_common-bundle.min.js +1 -1
- package/package.json +1 -1
|
@@ -24042,11 +24042,12 @@ func.runtime.render.get_root_data_system = function (SESSION_ID) {
|
|
|
24042
24042
|
func.runtime.render.resolve_xu_for_source = async function (SESSION_ID, dsSessionP, value) {
|
|
24043
24043
|
let arr = value;
|
|
24044
24044
|
let reference_source_obj;
|
|
24045
|
+
const normalized_reference = typeof value === 'string' && value.startsWith('@') ? value.substring(1) : value;
|
|
24045
24046
|
const _progFields = await func.datasource.get_progFields(SESSION_ID, dsSessionP);
|
|
24046
|
-
let view_field_obj = func.common.find_item_by_key(_progFields, 'field_id',
|
|
24047
|
+
let view_field_obj = func.common.find_item_by_key(_progFields, 'field_id', normalized_reference);
|
|
24047
24048
|
|
|
24048
|
-
if (view_field_obj) {
|
|
24049
|
-
reference_source_obj = await func.datasource.get_value(SESSION_ID,
|
|
24049
|
+
if (view_field_obj || normalized_reference !== value) {
|
|
24050
|
+
reference_source_obj = await func.datasource.get_value(SESSION_ID, normalized_reference, dsSessionP);
|
|
24050
24051
|
arr = reference_source_obj?.ret?.value;
|
|
24051
24052
|
} else {
|
|
24052
24053
|
if (typeof value === 'string') {
|
|
@@ -24202,8 +24203,14 @@ func.runtime.bind.resolve_field = async function (SESSION_ID, prog_id, dsSession
|
|
|
24202
24203
|
if (ret_get_value.found) {
|
|
24203
24204
|
_dsP = ret_get_value.dsSessionP;
|
|
24204
24205
|
let _ds = SESSION_OBJ[SESSION_ID].DS_GLB[_dsP];
|
|
24205
|
-
_prog_id = _ds
|
|
24206
|
+
_prog_id = _ds?.prog_id;
|
|
24206
24207
|
field_prop = await find_in_view(field_id, _prog_id);
|
|
24208
|
+
if (!field_prop) {
|
|
24209
|
+
field_prop = _ds?.dynamic_fields?.[field_id];
|
|
24210
|
+
if (field_prop) {
|
|
24211
|
+
is_dynamic_field = true;
|
|
24212
|
+
}
|
|
24213
|
+
}
|
|
24207
24214
|
}
|
|
24208
24215
|
}
|
|
24209
24216
|
}
|
|
@@ -28079,9 +28086,6 @@ func.runtime.ui.get_meta = function (xu_ui_id, key) {
|
|
|
28079
28086
|
return key ? entry[key] : entry;
|
|
28080
28087
|
};
|
|
28081
28088
|
func.runtime.ui.delete_meta = function (xu_ui_id) {
|
|
28082
|
-
if (func.runtime.ui._meta_store[xu_ui_id]) {
|
|
28083
|
-
console.info('[xu-render-debug] delete_meta called for', xu_ui_id, new Error().stack?.split('\n').slice(1, 4).join(' <- '));
|
|
28084
|
-
}
|
|
28085
28089
|
delete func.runtime.ui._meta_store[xu_ui_id];
|
|
28086
28090
|
// clean reverse lookup
|
|
28087
28091
|
for (const id in func.runtime.ui._element_id_to_xu_ui_id) {
|
|
@@ -28689,7 +28693,14 @@ func.runtime.ui.generate_xu_ui_id = async function (SESSION_ID, nodeP, $containe
|
|
|
28689
28693
|
return hashed_ui_id;
|
|
28690
28694
|
};
|
|
28691
28695
|
func.runtime.ui.create_container = async function (options) {
|
|
28692
|
-
|
|
28696
|
+
let _paramsP;
|
|
28697
|
+
try {
|
|
28698
|
+
_paramsP = JSON.parse(JSON.stringify(options.paramsP));
|
|
28699
|
+
} catch (e) {
|
|
28700
|
+
// paramsP may contain DOM element refs that create circular structures;
|
|
28701
|
+
// fall back to a shallow copy which is sufficient for create_container.
|
|
28702
|
+
_paramsP = Object.assign({}, options.paramsP);
|
|
28703
|
+
}
|
|
28693
28704
|
const _ds = SESSION_OBJ[options.SESSION_ID].DS_GLB[_paramsP.dsSessionP];
|
|
28694
28705
|
const $appendTo = func.runtime.ui.get_append_target(options.$container, options.$appendToP);
|
|
28695
28706
|
if (!$appendTo) return null;
|
|
@@ -30514,7 +30525,6 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
|
|
|
30514
30525
|
const perf_end = func.runtime?.perf?.start?.(SESSION_ID, 'execute_xu_render_attributes');
|
|
30515
30526
|
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);
|
|
30516
30527
|
const _data = live_context.data;
|
|
30517
|
-
console.info('[xu-render-debug] execute_xu_render_attributes', { elem_key: queue_obj.paramsP?.elem_key, has_live_elm: !!live_context.$elm?.length, has_data: !!_data, has_xuData: !!_data?.xuData, has_paramsP: !!_data?.xuData?.paramsP, attr_value: queue_obj.paramsP?.attr_value, elm_tag: func.runtime.ui.get_first_node(live_context.$elm)?.tagName, data_keys: Object.keys(_data || {}), xuData_keys: Object.keys(_data?.xuData || {}) });
|
|
30518
30528
|
try {
|
|
30519
30529
|
if (_data?.xuData?.paramsP) {
|
|
30520
30530
|
const live_xu_data = _data.xuData;
|
|
@@ -33766,7 +33776,6 @@ func.runtime.ui.refresh_xu_attributes = async function (options) {
|
|
|
33766
33776
|
const attr_value = await func.common.get_cast_val(options.SESSION_ID, 'refresh xu-attributes', 'xu-render', 'bool', res.result);
|
|
33767
33777
|
|
|
33768
33778
|
const _elm_node = func.runtime.ui.get_first_node($elm);
|
|
33769
|
-
console.info('[xu-render-debug] refresh has_xu_exp_render', { elem_key, attr_value, elm_tag: _elm_node?.tagName, exp_value: xuAttributes['xu-exp:xu-render'], result: res.result });
|
|
33770
33779
|
if (!attr_value && _elm_node?.tagName === 'XURENDER') continue;
|
|
33771
33780
|
|
|
33772
33781
|
if (attr_value && _elm_node?.tagName !== 'XURENDER') {
|
|
@@ -35369,8 +35378,8 @@ func.runtime.render.get_xu_for_iterators = function ($elm) {
|
|
|
35369
35378
|
return {
|
|
35370
35379
|
iterator_key: custom_iterator_key || '_FOR_KEY',
|
|
35371
35380
|
iterator_val: custom_iterator_val || '_FOR_VAL',
|
|
35372
|
-
is_key_dynamic_field:
|
|
35373
|
-
is_val_dynamic_field:
|
|
35381
|
+
is_key_dynamic_field: true,
|
|
35382
|
+
is_val_dynamic_field: true,
|
|
35374
35383
|
};
|
|
35375
35384
|
};
|
|
35376
35385
|
func.runtime.render.attach_iterate_info_to_children = function ($divP, iterate_info) {
|
|
@@ -36662,9 +36671,6 @@ func.runtime.widgets = func.runtime.widgets || {};
|
|
|
36662
36671
|
|
|
36663
36672
|
func.runtime.render.handle_legacy_xu_render = async function (options) {
|
|
36664
36673
|
const value = await func.common.get_cast_val(options.SESSION_ID, 'common fx', 'xu-render', 'bool', options.val.value);
|
|
36665
|
-
const _xu_ui_id_dbg = func.runtime.ui.get_attr(options.$elm, 'xu-ui-id');
|
|
36666
|
-
console.info('[xu-render-debug] handle_legacy_xu_render called', { value, is_init: options.is_init, xu_ui_id: _xu_ui_id_dbg, elm_tag: func.runtime.ui.get_first_node(options.$elm)?.tagName });
|
|
36667
|
-
|
|
36668
36674
|
const init_render = function () {
|
|
36669
36675
|
if (!value) {
|
|
36670
36676
|
const cloned_div = func.runtime.ui.get_first_node(options.$elm)?.cloneNode(true);
|
|
@@ -36682,8 +36688,6 @@ func.runtime.render.handle_legacy_xu_render = async function (options) {
|
|
|
36682
36688
|
const snapshot_xuAttributes = options.nodeP.attributes || {};
|
|
36683
36689
|
const xu_ui_id = func.runtime.ui.get_attr(options.$elm, 'xu-ui-id');
|
|
36684
36690
|
|
|
36685
|
-
console.info('[xu-render-debug] init_render hiding', { xu_ui_id, has_snapshot_xuData: !!snapshot_xuData, has_paramsP: !!snapshot_xuData?.paramsP, has_original_data_obj: !!original_data_obj, snapshot_xuAttributes_keys: Object.keys(snapshot_xuAttributes) });
|
|
36686
|
-
|
|
36687
36691
|
// Remove original element from DOM WITHOUT deleting _meta_store.
|
|
36688
36692
|
const _elm_node = func.runtime.ui.get_first_node(options.$elm);
|
|
36689
36693
|
if (_elm_node?.remove) {
|
|
@@ -36699,10 +36703,6 @@ func.runtime.render.handle_legacy_xu_render = async function (options) {
|
|
|
36699
36703
|
xuAttributes: snapshot_xuAttributes,
|
|
36700
36704
|
});
|
|
36701
36705
|
|
|
36702
|
-
// Verify data was written correctly
|
|
36703
|
-
const verify_meta = func.runtime.ui._meta_store[xu_ui_id];
|
|
36704
|
-
console.info('[xu-render-debug] init_render DONE', { xu_ui_id, meta_exists: !!verify_meta, has_xuData: !!verify_meta?.xuData, has_paramsP: !!verify_meta?.xuData?.paramsP, has_original_data_obj: !!verify_meta?.xuData?.original_data_obj, has_xuAttributes: !!verify_meta?.xuAttributes });
|
|
36705
|
-
|
|
36706
36706
|
return { abort: true };
|
|
36707
36707
|
}
|
|
36708
36708
|
return {};
|
|
@@ -36734,18 +36734,12 @@ func.runtime.render.handle_legacy_xu_render = async function (options) {
|
|
|
36734
36734
|
if (value) {
|
|
36735
36735
|
try {
|
|
36736
36736
|
const elm_node = func.runtime.ui.get_first_node(options.$elm);
|
|
36737
|
-
const _post_xu_ui_id = func.runtime.ui.get_attr(options.$elm, 'xu-ui-id');
|
|
36738
|
-
const _post_meta = func.runtime.ui._meta_store[_post_xu_ui_id];
|
|
36739
|
-
const _post_data = func.runtime.ui.get_data(options.$elm);
|
|
36740
|
-
console.info('[xu-render-debug] post_render value=true', { xu_ui_id: _post_xu_ui_id, elm_tag: elm_node?.tagName, meta_exists: !!_post_meta, has_xuData: !!_post_data?.xuData, has_paramsP: !!_post_data?.xuData?.paramsP, has_original_data_obj: !!_post_data?.xuData?.original_data_obj, xuData_keys: Object.keys(_post_data?.xuData || {}), data_keys: Object.keys(_post_data || {}) });
|
|
36741
36737
|
if (elm_node?.tagName !== 'XURENDER' && elm_node) {
|
|
36742
|
-
console.info('[xu-render-debug] post_render SKIP: not XURENDER tag', elm_node?.tagName);
|
|
36743
36738
|
return func.events.delete_job(options.SESSION_ID, options.jobNoP);
|
|
36744
36739
|
}
|
|
36745
36740
|
|
|
36746
36741
|
const original_data_obj = func.runtime.ui.get_data(options.$elm).xuData.original_data_obj;
|
|
36747
36742
|
if (!original_data_obj) {
|
|
36748
|
-
console.info('[xu-render-debug] post_render SKIP: no original_data_obj');
|
|
36749
36743
|
func.events.delete_job(options.SESSION_ID, options.jobNoP);
|
|
36750
36744
|
return { delete_job: options.jobNoP };
|
|
36751
36745
|
}
|