@xuda.io/runtime-bundle 1.0.680 → 1.0.682
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 +186 -111
- package/js/xuda-runtime-bundle.min.js +1 -1
- package/js/xuda-runtime-slim.js +186 -111
- package/js/xuda-runtime-slim.min.es.js +186 -111
- package/js/xuda-runtime-slim.min.js +1 -1
- package/js/xuda-server-bundle.min.mjs +1 -1
- package/js/xuda-server-bundle.mjs +2 -1
- package/js/xuda-worker-bundle.js +2 -1
- package/js/xuda-worker-bundle.min.js +1 -1
- package/package.json +1 -1
package/js/xuda-runtime-slim.js
CHANGED
|
@@ -3858,7 +3858,8 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
|
|
|
3858
3858
|
}
|
|
3859
3859
|
|
|
3860
3860
|
// initiated with Update but no rows found
|
|
3861
|
-
if (tree_obj.crudMode === 'U' && tree_obj.allowCreate && !_ds?.data_feed?.rows?.length) {
|
|
3861
|
+
// if (tree_obj.crudMode === 'U' && tree_obj.allowCreate && !_ds?.data_feed?.rows?.length) {
|
|
3862
|
+
if (tree_obj.crudMode === 'U' && tree_obj.allowCreate && !_raw_data_rows?.length) {
|
|
3862
3863
|
_ds.set_mode = 'C';
|
|
3863
3864
|
// _raw_data_rows[glb.newRecord] = [{ _ROWID: "newRecord" }];
|
|
3864
3865
|
|
|
@@ -11758,88 +11759,105 @@ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, j
|
|
|
11758
11759
|
};
|
|
11759
11760
|
|
|
11760
11761
|
func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr, datasource_changed, fields_changed_datasource) {
|
|
11761
|
-
|
|
11762
|
-
|
|
11763
|
-
|
|
11764
|
-
|
|
11765
|
-
|
|
11766
|
-
|
|
11767
|
-
|
|
11768
|
-
|
|
11769
|
-
|
|
11762
|
+
var found, refresh_reason, refresh_details;
|
|
11763
|
+
const validate_change = function (prog_doc, panelXuAttributes) {
|
|
11764
|
+
found = null;
|
|
11765
|
+
refresh_reason = null;
|
|
11766
|
+
refresh_details = null;
|
|
11767
|
+
const progDataSource_str = JSON.stringify(prog_doc.progDataSource);
|
|
11768
|
+
for (const field_id of fields_changed_arr) {
|
|
11769
|
+
// get panel attributes
|
|
11770
|
+
const _attributes = panelXuAttributes || {};
|
|
11771
|
+
|
|
11772
|
+
// detect if program changed
|
|
11773
|
+
found = _attributes['xu-exp:program']?.includes('@' + field_id);
|
|
11774
|
+
|
|
11775
|
+
if (found) {
|
|
11776
|
+
refresh_reason = `program ${_attributes['xu-exp:program']} ${field_id} changed `;
|
|
11777
|
+
refresh_details = _attributes;
|
|
11778
|
+
break;
|
|
11770
11779
|
}
|
|
11771
|
-
for (const field_id of fields_changed_arr) {
|
|
11772
|
-
// get panel attributes
|
|
11773
|
-
const _attributes = panel_val?.panelXuAttributes || {};
|
|
11774
11780
|
|
|
11775
|
-
|
|
11776
|
-
|
|
11781
|
+
// _attributes holds also info of parameters in code_in: @code
|
|
11782
|
+
// search field changed in panel call send parameters exp
|
|
11783
|
+
for (const [attr, value] of Object.entries(_attributes)) {
|
|
11784
|
+
const pattern = /xu-exp:(\w+)/;
|
|
11785
|
+
const match = attr.match(pattern);
|
|
11777
11786
|
|
|
11778
|
-
if (
|
|
11779
|
-
|
|
11780
|
-
|
|
11781
|
-
break;
|
|
11787
|
+
if (!match) {
|
|
11788
|
+
// continue if attribute is not expression
|
|
11789
|
+
continue;
|
|
11782
11790
|
}
|
|
11791
|
+
// code_in
|
|
11792
|
+
const parameter_in_field_id = match?.[1];
|
|
11793
|
+
// @code
|
|
11794
|
+
if (value.includes(field_id)) {
|
|
11795
|
+
// search parameter in field in the target program's progDataSource
|
|
11796
|
+
found = progDataSource_str?.includes('@' + parameter_in_field_id);
|
|
11783
11797
|
|
|
11784
|
-
|
|
11785
|
-
|
|
11786
|
-
|
|
11787
|
-
const pattern = /xu-exp:(\w+)/;
|
|
11788
|
-
const match = attr.match(pattern);
|
|
11798
|
+
if (found) {
|
|
11799
|
+
refresh_reason = `field ${field_id} in progDataSource parameter_in changed`;
|
|
11800
|
+
refresh_details = prog_doc?.progDataSource;
|
|
11789
11801
|
|
|
11790
|
-
|
|
11791
|
-
// continue if attribute is not expression
|
|
11792
|
-
continue;
|
|
11802
|
+
break;
|
|
11793
11803
|
}
|
|
11794
|
-
// code_in
|
|
11795
|
-
const parameter_in_field_id = match?.[1];
|
|
11796
|
-
// @code
|
|
11797
|
-
if (value.includes(field_id)) {
|
|
11798
|
-
// search parameter in field in the target program's progDataSource
|
|
11799
|
-
found = progDataSource_str?.includes('@' + parameter_in_field_id);
|
|
11800
11804
|
|
|
11801
|
-
|
|
11802
|
-
refresh_reason = `field ${field_id} in progDataSource parameter_in changed`;
|
|
11803
|
-
refresh_details = panel_val?.prog_doc?.progDataSource;
|
|
11805
|
+
found = func.UI.find_field_in_progUi_attributes(prog_doc.progUi, parameter_in_field_id, 'xu-for').length;
|
|
11804
11806
|
|
|
11805
|
-
|
|
11806
|
-
}
|
|
11807
|
-
|
|
11808
|
-
// found = find_field_in_progUi(prog_doc.progUi, parameter_in_field_id, 'xu-for');
|
|
11809
|
-
found = func.UI.find_field_in_progUi_attributes(panel_val.prog_doc.progUi, parameter_in_field_id, 'xu-for').length;
|
|
11807
|
+
if (found) {
|
|
11808
|
+
refresh_reason = `field ${field_id} in progUi xu-for parameter_in changed`;
|
|
11809
|
+
refresh_details = found;
|
|
11810
11810
|
|
|
11811
|
-
|
|
11812
|
-
refresh_reason = `field ${field_id} in progUi xu-for parameter_in changed`;
|
|
11813
|
-
refresh_details = found;
|
|
11814
|
-
|
|
11815
|
-
break;
|
|
11816
|
-
}
|
|
11811
|
+
break;
|
|
11817
11812
|
}
|
|
11818
11813
|
}
|
|
11814
|
+
}
|
|
11819
11815
|
|
|
11820
|
-
|
|
11816
|
+
if (found) break;
|
|
11821
11817
|
|
|
11822
|
-
|
|
11823
|
-
|
|
11824
|
-
|
|
11825
|
-
|
|
11826
|
-
|
|
11818
|
+
// search field changed in the target program's progDataSource // @code
|
|
11819
|
+
found = progDataSource_str?.includes('@' + field_id);
|
|
11820
|
+
if (found) {
|
|
11821
|
+
refresh_reason = `field ${field_id} in progDataSource changed`;
|
|
11822
|
+
refresh_details = prog_doc?.progDataSource;
|
|
11827
11823
|
|
|
11828
|
-
|
|
11829
|
-
|
|
11824
|
+
break;
|
|
11825
|
+
}
|
|
11830
11826
|
|
|
11831
|
-
|
|
11832
|
-
|
|
11833
|
-
|
|
11834
|
-
|
|
11827
|
+
found = func.UI.find_field_in_progUi_attributes(prog_doc.progUi, field_id, 'xu-for').length;
|
|
11828
|
+
if (found) {
|
|
11829
|
+
refresh_reason = `field ${field_id} in progUi xu-for changed`;
|
|
11830
|
+
refresh_details = found;
|
|
11835
11831
|
|
|
11836
|
-
|
|
11837
|
-
|
|
11832
|
+
break;
|
|
11833
|
+
}
|
|
11838
11834
|
|
|
11839
|
-
|
|
11840
|
-
|
|
11841
|
-
|
|
11835
|
+
if (found) {
|
|
11836
|
+
break;
|
|
11837
|
+
}
|
|
11838
|
+
}
|
|
11839
|
+
};
|
|
11840
|
+
|
|
11841
|
+
// check the main program
|
|
11842
|
+
if (fields_changed_datasource) {
|
|
11843
|
+
const _session = SESSION_OBJ[SESSION_ID];
|
|
11844
|
+
const _ds = _session.DS_GLB[fields_changed_datasource];
|
|
11845
|
+
const prog_doc = await func.utils.DOCS_OBJ.get(SESSION_ID, _ds.prog_id);
|
|
11846
|
+
// const progDataSource_str = JSON.stringify(prog_doc.progDataSource);
|
|
11847
|
+
for (const field_id of fields_changed_arr || []) {
|
|
11848
|
+
}
|
|
11849
|
+
}
|
|
11850
|
+
|
|
11851
|
+
const panels_obj = await func.UI.utils.get_panels_wrapper_from_dom(SESSION_ID, $(SESSION_OBJ[SESSION_ID].root_element), false);
|
|
11852
|
+
|
|
11853
|
+
for await (const [parent_element_ui_id, panel_val] of Object.entries(panels_obj)) {
|
|
11854
|
+
// const progDataSource_str = JSON.stringify(panel_val.prog_doc.progDataSource);
|
|
11855
|
+
|
|
11856
|
+
if (fields_changed_arr) {
|
|
11857
|
+
if (fields_changed_datasource && panel_val._ds.dsSession <= Number(fields_changed_datasource)) {
|
|
11858
|
+
continue;
|
|
11842
11859
|
}
|
|
11860
|
+
validate_change(panel_val.prog_doc, panel_val?.panelXuAttributes);
|
|
11843
11861
|
}
|
|
11844
11862
|
|
|
11845
11863
|
if (datasource_changed) {
|
|
@@ -11910,25 +11928,40 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
|
|
|
11910
11928
|
}
|
|
11911
11929
|
};
|
|
11912
11930
|
|
|
11913
|
-
// func.UI.screen.
|
|
11914
|
-
//
|
|
11931
|
+
// func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr, datasource_changed, fields_changed_datasource) {
|
|
11932
|
+
// // check the main program
|
|
11933
|
+
// if (fields_changed_datasource) {
|
|
11934
|
+
// const _session = SESSION_OBJ[SESSION_ID];
|
|
11935
|
+
// const _ds = _session.DS_GLB[fields_changed_datasource];
|
|
11936
|
+
// const prog_doc = await func.utils.DOCS_OBJ.get(SESSION_ID, _ds.prog_id);
|
|
11937
|
+
// const progDataSource_str = JSON.stringify(prog_doc.progDataSource);
|
|
11938
|
+
// for (const field_id of fields_changed_arr || []) {
|
|
11939
|
+
|
|
11940
|
+
// }
|
|
11941
|
+
// }
|
|
11942
|
+
|
|
11943
|
+
// const panels_obj = await func.UI.utils.get_panels_wrapper_from_dom(SESSION_ID, $(SESSION_OBJ[SESSION_ID].root_element), false);
|
|
11915
11944
|
|
|
11916
11945
|
// for await (const [parent_element_ui_id, panel_val] of Object.entries(panels_obj)) {
|
|
11917
|
-
// const
|
|
11918
|
-
// const progDataSource_str = JSON.stringify(prog_doc.progDataSource);
|
|
11946
|
+
// const progDataSource_str = JSON.stringify(panel_val.prog_doc.progDataSource);
|
|
11919
11947
|
|
|
11920
|
-
// var found;
|
|
11948
|
+
// var found, refresh_reason, refresh_details;
|
|
11921
11949
|
// if (fields_changed_arr) {
|
|
11922
|
-
// if (fields_changed_datasource && panel_val._ds.dsSession
|
|
11950
|
+
// if (fields_changed_datasource && panel_val._ds.dsSession <= Number(fields_changed_datasource)) {
|
|
11923
11951
|
// continue;
|
|
11924
11952
|
// }
|
|
11925
11953
|
// for (const field_id of fields_changed_arr) {
|
|
11926
11954
|
// // get panel attributes
|
|
11927
|
-
// const _attributes = panel_val
|
|
11955
|
+
// const _attributes = panel_val?.panelXuAttributes || {};
|
|
11928
11956
|
|
|
11929
11957
|
// // detect if program changed
|
|
11930
11958
|
// found = _attributes['xu-exp:program']?.includes('@' + field_id);
|
|
11931
|
-
|
|
11959
|
+
|
|
11960
|
+
// if (found) {
|
|
11961
|
+
// refresh_reason = `program ${_attributes['xu-exp:program']} ${field_id} changed `;
|
|
11962
|
+
// refresh_details = _attributes;
|
|
11963
|
+
// break;
|
|
11964
|
+
// }
|
|
11932
11965
|
|
|
11933
11966
|
// // _attributes holds also info of parameters in code_in: @code
|
|
11934
11967
|
// // search field changed in panel call send parameters exp
|
|
@@ -11946,11 +11979,23 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
|
|
|
11946
11979
|
// if (value.includes(field_id)) {
|
|
11947
11980
|
// // search parameter in field in the target program's progDataSource
|
|
11948
11981
|
// found = progDataSource_str?.includes('@' + parameter_in_field_id);
|
|
11949
|
-
|
|
11982
|
+
|
|
11983
|
+
// if (found) {
|
|
11984
|
+
// refresh_reason = `field ${field_id} in progDataSource parameter_in changed`;
|
|
11985
|
+
// refresh_details = panel_val?.prog_doc?.progDataSource;
|
|
11986
|
+
|
|
11987
|
+
// break;
|
|
11988
|
+
// }
|
|
11950
11989
|
|
|
11951
11990
|
// // found = find_field_in_progUi(prog_doc.progUi, parameter_in_field_id, 'xu-for');
|
|
11952
|
-
// found = func.UI.find_field_in_progUi_attributes(prog_doc.progUi, parameter_in_field_id, 'xu-for').length;
|
|
11953
|
-
|
|
11991
|
+
// found = func.UI.find_field_in_progUi_attributes(panel_val.prog_doc.progUi, parameter_in_field_id, 'xu-for').length;
|
|
11992
|
+
|
|
11993
|
+
// if (found) {
|
|
11994
|
+
// refresh_reason = `field ${field_id} in progUi xu-for parameter_in changed`;
|
|
11995
|
+
// refresh_details = found;
|
|
11996
|
+
|
|
11997
|
+
// break;
|
|
11998
|
+
// }
|
|
11954
11999
|
// }
|
|
11955
12000
|
// }
|
|
11956
12001
|
|
|
@@ -11958,63 +12003,93 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
|
|
|
11958
12003
|
|
|
11959
12004
|
// // search field changed in the target program's progDataSource // @code
|
|
11960
12005
|
// found = progDataSource_str?.includes('@' + field_id);
|
|
11961
|
-
// if (found)
|
|
12006
|
+
// if (found) {
|
|
12007
|
+
// refresh_reason = `field ${field_id} in progDataSource changed`;
|
|
12008
|
+
// refresh_details = panel_val?.prog_doc?.progDataSource;
|
|
12009
|
+
|
|
12010
|
+
// break;
|
|
12011
|
+
// }
|
|
12012
|
+
|
|
12013
|
+
// found = func.UI.find_field_in_progUi_attributes(panel_val.prog_doc.progUi, field_id, 'xu-for').length;
|
|
12014
|
+
// if (found) {
|
|
12015
|
+
// refresh_reason = `field ${field_id} in progUi xu-for changed`;
|
|
12016
|
+
// refresh_details = found;
|
|
12017
|
+
|
|
12018
|
+
// break;
|
|
12019
|
+
// }
|
|
12020
|
+
|
|
12021
|
+
// if (found) {
|
|
12022
|
+
// break;
|
|
12023
|
+
// }
|
|
11962
12024
|
// }
|
|
11963
12025
|
// }
|
|
11964
12026
|
|
|
11965
12027
|
// if (datasource_changed) {
|
|
11966
12028
|
// if (panel_val._ds.dsSession == datasource_changed) {
|
|
12029
|
+
// refresh_reason = `panel datasource ${datasource_changed} changed`;
|
|
12030
|
+
// refresh_details = '';
|
|
12031
|
+
|
|
11967
12032
|
// found = true;
|
|
11968
12033
|
// }
|
|
11969
12034
|
// }
|
|
11970
12035
|
// if (found) {
|
|
11971
|
-
//
|
|
11972
|
-
//
|
|
11973
|
-
// .
|
|
11974
|
-
// .
|
|
12036
|
+
// const _session = SESSION_OBJ[SESSION_ID];
|
|
12037
|
+
// if (_session.engine_mode === 'live_preview') {
|
|
12038
|
+
// console.info('========= refresh info ==============');
|
|
12039
|
+
// console.info('reason:', refresh_reason);
|
|
12040
|
+
// console.info('details:', refresh_details);
|
|
12041
|
+
// console.info('panel:', panel_val);
|
|
12042
|
+
// console.info('=====================================');
|
|
12043
|
+
// }
|
|
12044
|
+
// const $div_elm = panel_val.$panel_div;
|
|
12045
|
+
// const wrapper_data = $div_elm.data();
|
|
12046
|
+
|
|
12047
|
+
// if (_.isEmpty(wrapper_data)) continue;
|
|
11975
12048
|
|
|
11976
|
-
// // restore original panel
|
|
11977
12049
|
// try {
|
|
11978
|
-
//
|
|
12050
|
+
// const ts = Date.now();
|
|
12051
|
+
// // remove old panel content
|
|
12052
|
+
// $.each(panel_val.ids, async function (key, val) {
|
|
12053
|
+
// $("[xu-ui-id='" + val + "']")
|
|
12054
|
+
// .attr('xu-ui-id', val + ts)
|
|
12055
|
+
// .removeData();
|
|
12056
|
+
// });
|
|
11979
12057
|
|
|
11980
|
-
//
|
|
12058
|
+
// let refreshed_ds;
|
|
12059
|
+
// // check if ds exist and deleted by garbage collector
|
|
12060
|
+
|
|
12061
|
+
// if (_session.DS_GLB[panel_val._ds.dsSession]) {
|
|
12062
|
+
// refreshed_ds = panel_val._ds.dsSession;
|
|
12063
|
+
// }
|
|
12064
|
+
// for await (const item of wrapper_data.xuData.node_org.children) {
|
|
12065
|
+
// if (item.tagName !== 'xu-panel') continue;
|
|
12066
|
+
|
|
12067
|
+
// const new_$div = await func.UI.screen.render_ui_tree(
|
|
12068
|
+
// SESSION_ID,
|
|
12069
|
+
// $div_elm, // the wrapper
|
|
12070
|
+
// _.cloneDeep(item), // _.cloneDeep(wrapper_data.xuData.node_org.children[0]), // the xu-panel node
|
|
12071
|
+
// {},
|
|
12072
|
+
// wrapper_data.xuData.paramsP, // the wrapper params
|
|
12073
|
+
// null,
|
|
12074
|
+
// null,
|
|
12075
|
+
// wrapper_data.xuData.key, // the wrapper key
|
|
12076
|
+
// refreshed_ds, // the refreshed_ds
|
|
12077
|
+
// wrapper_data.xuData.parent_node, // the wrapper parent node
|
|
12078
|
+
// null,
|
|
12079
|
+
// wrapper_data.xuData.$root_container, // the wrapper root container
|
|
12080
|
+
// );
|
|
12081
|
+
// }
|
|
11981
12082
|
|
|
11982
12083
|
// // remove old panel content
|
|
11983
12084
|
// $.each(panel_val.ids, async function (key, val) {
|
|
11984
|
-
// $("[xu-ui-id='" + val + "']").remove();
|
|
12085
|
+
// $("[xu-ui-id='" + val + ts + "']").remove();
|
|
11985
12086
|
// });
|
|
11986
12087
|
// } catch (error) {
|
|
11987
12088
|
// debugger;
|
|
11988
12089
|
// }
|
|
11989
|
-
//
|
|
11990
|
-
// }
|
|
11991
|
-
// }
|
|
11992
|
-
// };
|
|
11993
|
-
|
|
11994
|
-
// const get_params_obj = async function (SESSION_ID, prog_id, parameters_obj_inP) {
|
|
11995
|
-
// const _prog = await func.utils.VIEWS_OBJ.get(SESSION_ID, prog_id);
|
|
11996
|
-
// if (!_prog) {
|
|
11997
|
-
// return;
|
|
11998
|
-
// }
|
|
11999
|
-
|
|
12000
|
-
// // get in parameters
|
|
12001
|
-
// var params_obj = {};
|
|
12002
|
-
// if (_prog?.properties?.progParams) {
|
|
12003
|
-
// for await (const [key, val] of Object.entries(_prog.properties.progParams)) {
|
|
12004
|
-
// if (!val.data.dir === 'in') continue;
|
|
12005
|
-
// if (typeof parameters_obj_inP?.[val.data.parameter] !== 'undefined') {
|
|
12006
|
-
// if (parameters_obj_inP?.[val.data.parameter].fx) {
|
|
12007
|
-
// let ret = await func.expression.get(SESSION_ID, parameters_obj_inP?.[val.data.parameter].fx, dsSession, 'parameters');
|
|
12008
|
-
// params_obj[val.data.parameter] = ret.result;
|
|
12009
|
-
// } else {
|
|
12010
|
-
// params_obj[val.data.parameter] = parameters_obj_inP?.[val.data.parameter].value;
|
|
12011
|
-
// }
|
|
12012
|
-
// continue;
|
|
12013
|
-
// }
|
|
12014
|
-
// console.warn(`Warning: Program ${_prog.properties.menuName} expected In parameter: ${val.data.parameter} but received null instead`);
|
|
12090
|
+
// // continue;
|
|
12015
12091
|
// }
|
|
12016
12092
|
// }
|
|
12017
|
-
// return params_obj;
|
|
12018
12093
|
// };
|
|
12019
12094
|
|
|
12020
12095
|
const get_params_obj_new = async function (SESSION_ID, prog_id, nodeP, dsSession) {
|