@xuda.io/runtime-bundle 1.0.272 → 1.0.273
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.
|
@@ -33758,18 +33758,7 @@ func.UI.screen.execute_xu_functions = async function (
|
|
|
33758
33758
|
if (is_skeleton) return;
|
|
33759
33759
|
|
|
33760
33760
|
let view_field_id = val.value;
|
|
33761
|
-
|
|
33762
|
-
if (!_.isEmpty($elm?.data()?.xuAttributes?.["xu-exp:xu-bind"])) {
|
|
33763
|
-
const res = (
|
|
33764
|
-
await func.expression.get(
|
|
33765
|
-
SESSION_ID,
|
|
33766
|
-
$elm.data().xuAttributes["xu-exp:xu-bind"],
|
|
33767
|
-
paramsP.dsSessionP,
|
|
33768
|
-
"UI Attr EXP"
|
|
33769
|
-
)
|
|
33770
|
-
)
|
|
33771
|
-
console.log(res)
|
|
33772
|
-
}
|
|
33761
|
+
|
|
33773
33762
|
|
|
33774
33763
|
let _prog_id = $elm.data().xuData.paramsP.prog_id;
|
|
33775
33764
|
let _dsP = $elm.data().xuData.paramsP.dsSessionP;
|
|
@@ -33777,46 +33766,79 @@ func.UI.screen.execute_xu_functions = async function (
|
|
|
33777
33766
|
if (!view_ret) return {};
|
|
33778
33767
|
|
|
33779
33768
|
let is_dynamic_field = false
|
|
33780
|
-
let field_prop
|
|
33769
|
+
let field_prop;
|
|
33770
|
+
let bind_field_id
|
|
33781
33771
|
|
|
33782
|
-
|
|
33783
|
-
|
|
33784
|
-
|
|
33785
|
-
|
|
33786
|
-
|
|
33787
|
-
|
|
33788
|
-
|
|
33789
|
-
|
|
33790
|
-
|
|
33791
|
-
if (!field_prop) {
|
|
33792
|
-
/// find the field everywhere in the chain Aug 30 2024
|
|
33793
|
-
const ret_get_value = await func.datasource.get_value(
|
|
33794
|
-
SESSION_ID,
|
|
33795
|
-
view_field_id,
|
|
33796
|
-
_dsP // $elm.data().xuData.paramsP.dsSessionP
|
|
33772
|
+
const get_bind_field = async function (field_id) {
|
|
33773
|
+
if (["_FOR_VAL", "_FOR_KEY"].includes(field_id)) {
|
|
33774
|
+
is_dynamic_field = true
|
|
33775
|
+
field_prop = _ds.dynamic_fields[field_id]
|
|
33776
|
+
} else {
|
|
33777
|
+
field_prop = func.common.find_item_by_key(
|
|
33778
|
+
view_ret.progFields,
|
|
33779
|
+
"field_id",
|
|
33780
|
+
field_id
|
|
33797
33781
|
);
|
|
33798
|
-
|
|
33799
|
-
if (ret_get_value.found) {
|
|
33800
|
-
_dsP = ret_get_value.dsSessionP;
|
|
33801
|
-
let _ds = SESSION_OBJ[SESSION_ID].DS_GLB[_dsP];
|
|
33802
|
-
_prog_id = _ds.prog_id;
|
|
33803
|
-
const view_ret = await func.utils.VIEWS_OBJ.get(SESSION_ID, _prog_id);
|
|
33804
|
-
if (!view_ret) return {};
|
|
33805
|
-
field_prop = func.common.find_item_by_key(
|
|
33806
|
-
view_ret.progFields,
|
|
33807
|
-
"field_id",
|
|
33808
|
-
view_field_id
|
|
33809
|
-
);
|
|
33810
|
-
}
|
|
33811
33782
|
if (!field_prop) {
|
|
33812
|
-
|
|
33813
|
-
|
|
33783
|
+
/// find the field everywhere in the chain Aug 30 2024
|
|
33784
|
+
const ret_get_value = await func.datasource.get_value(
|
|
33785
|
+
SESSION_ID,
|
|
33786
|
+
field_id,
|
|
33787
|
+
_dsP // $elm.data().xuData.paramsP.dsSessionP
|
|
33814
33788
|
);
|
|
33815
|
-
|
|
33789
|
+
|
|
33790
|
+
if (ret_get_value.found) {
|
|
33791
|
+
_dsP = ret_get_value.dsSessionP;
|
|
33792
|
+
let _ds = SESSION_OBJ[SESSION_ID].DS_GLB[_dsP];
|
|
33793
|
+
_prog_id = _ds.prog_id;
|
|
33794
|
+
const view_ret = await func.utils.VIEWS_OBJ.get(SESSION_ID, _prog_id);
|
|
33795
|
+
if (!view_ret) return {};
|
|
33796
|
+
field_prop = func.common.find_item_by_key(
|
|
33797
|
+
view_ret.progFields,
|
|
33798
|
+
"field_id",
|
|
33799
|
+
field_id
|
|
33800
|
+
);
|
|
33801
|
+
}
|
|
33802
|
+
if (!field_prop) {
|
|
33803
|
+
throw (`field ${field_id} not found in the program scope`)
|
|
33804
|
+
}
|
|
33816
33805
|
}
|
|
33817
33806
|
}
|
|
33807
|
+
return field_id
|
|
33818
33808
|
}
|
|
33819
33809
|
|
|
33810
|
+
try {
|
|
33811
|
+
bind_field_id = await get_bind_field(val.value)
|
|
33812
|
+
} catch (err) {
|
|
33813
|
+
try {
|
|
33814
|
+
|
|
33815
|
+
if (!_.isEmpty($elm?.data()?.xuAttributes?.["xu-exp:xu-bind"])) {
|
|
33816
|
+
const res = (
|
|
33817
|
+
await func.expression.get(
|
|
33818
|
+
SESSION_ID,
|
|
33819
|
+
$elm.data().xuAttributes["xu-exp:xu-bind"],
|
|
33820
|
+
paramsP.dsSessionP,
|
|
33821
|
+
"UI Attr EXP"
|
|
33822
|
+
)
|
|
33823
|
+
)
|
|
33824
|
+
|
|
33825
|
+
if (Object.keys(res.fields).length) {
|
|
33826
|
+
const field_id_from_exp = Object.keys(res.fields)[0]
|
|
33827
|
+
bind_field_id = await get_bind_field(field_id_from_exp)
|
|
33828
|
+
} else {
|
|
33829
|
+
throw (err.message)
|
|
33830
|
+
}
|
|
33831
|
+
} else {
|
|
33832
|
+
throw (err.message)
|
|
33833
|
+
}
|
|
33834
|
+
} catch (err) {
|
|
33835
|
+
console.error(err.message);
|
|
33836
|
+
return {};
|
|
33837
|
+
}
|
|
33838
|
+
return {};
|
|
33839
|
+
}
|
|
33840
|
+
|
|
33841
|
+
|
|
33820
33842
|
const field_changed = async function (e) {
|
|
33821
33843
|
|
|
33822
33844
|
var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[_dsP];
|
|
@@ -33835,7 +33857,7 @@ func.UI.screen.execute_xu_functions = async function (
|
|
|
33835
33857
|
let datasource_changes = {
|
|
33836
33858
|
[_dsP]: {
|
|
33837
33859
|
[_ds.currentRecordId]: {
|
|
33838
|
-
[
|
|
33860
|
+
[bind_field_id]: value,
|
|
33839
33861
|
},
|
|
33840
33862
|
},
|
|
33841
33863
|
};
|
|
@@ -33845,7 +33867,7 @@ func.UI.screen.execute_xu_functions = async function (
|
|
|
33845
33867
|
const reference_source_obj = iterate_info?.reference_source_obj
|
|
33846
33868
|
if (reference_source_obj) {
|
|
33847
33869
|
if (reference_source_obj.ret.type === "array") {
|
|
33848
|
-
if (iterate_info.iterator_val ===
|
|
33870
|
+
if (iterate_info.iterator_val === bind_field_id) {
|
|
33849
33871
|
let new_arr = reference_source_obj.ret.value
|
|
33850
33872
|
new_arr[Number($elm?.data()?.xuData?.iterate_info._key)] = value
|
|
33851
33873
|
datasource_changes[_dsP][_ds.currentRecordId][reference_source_obj.fieldIdP] = new_arr
|
|
@@ -33881,7 +33903,7 @@ func.UI.screen.execute_xu_functions = async function (
|
|
|
33881
33903
|
let value
|
|
33882
33904
|
try {
|
|
33883
33905
|
if (is_dynamic_field) {
|
|
33884
|
-
value = _ds.dynamic_fields[
|
|
33906
|
+
value = _ds.dynamic_fields[bind_field_id].value;
|
|
33885
33907
|
} else {
|
|
33886
33908
|
const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
|
|
33887
33909
|
value = _ds.data_feed.rows?.[row_idx]?.[val.value];
|