@xuda.io/runtime-bundle 1.0.715 → 1.0.716
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 +205 -206
- package/js/xuda-runtime-bundle.min.js +1 -1
- package/js/xuda-runtime-slim.js +202 -203
- package/js/xuda-runtime-slim.min.es.js +202 -203
- package/js/xuda-runtime-slim.min.js +1 -1
- package/package.json +1 -1
package/js/xuda-runtime-slim.js
CHANGED
|
@@ -11788,7 +11788,7 @@ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, j
|
|
|
11788
11788
|
}
|
|
11789
11789
|
};
|
|
11790
11790
|
|
|
11791
|
-
func.UI.screen.
|
|
11791
|
+
func.UI.screen.refresh_screen_bad = async function (SESSION_ID, fields_changed_arr, datasource_changed, fields_changed_datasource) {
|
|
11792
11792
|
var found, refresh_reason, refresh_details;
|
|
11793
11793
|
const validate_change = function (prog_doc, panelXuAttributes, skip_ui_check) {
|
|
11794
11794
|
found = null;
|
|
@@ -11870,71 +11870,71 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
|
|
|
11870
11870
|
}
|
|
11871
11871
|
};
|
|
11872
11872
|
|
|
11873
|
-
//
|
|
11874
|
-
|
|
11875
|
-
|
|
11876
|
-
|
|
11877
|
-
|
|
11878
|
-
|
|
11879
|
-
|
|
11880
|
-
|
|
11881
|
-
|
|
11882
|
-
|
|
11883
|
-
|
|
11884
|
-
|
|
11885
|
-
|
|
11886
|
-
|
|
11887
|
-
|
|
11888
|
-
|
|
11889
|
-
|
|
11890
|
-
|
|
11891
|
-
|
|
11892
|
-
|
|
11893
|
-
|
|
11894
|
-
|
|
11895
|
-
|
|
11896
|
-
|
|
11897
|
-
|
|
11898
|
-
|
|
11899
|
-
|
|
11900
|
-
|
|
11901
|
-
|
|
11902
|
-
|
|
11903
|
-
|
|
11904
|
-
|
|
11905
|
-
|
|
11906
|
-
|
|
11907
|
-
|
|
11908
|
-
|
|
11909
|
-
|
|
11910
|
-
|
|
11911
|
-
|
|
11912
|
-
|
|
11913
|
-
|
|
11914
|
-
|
|
11915
|
-
|
|
11916
|
-
|
|
11917
|
-
|
|
11918
|
-
|
|
11919
|
-
|
|
11920
|
-
|
|
11921
|
-
|
|
11922
|
-
|
|
11923
|
-
|
|
11924
|
-
|
|
11925
|
-
|
|
11926
|
-
|
|
11927
|
-
|
|
11928
|
-
|
|
11929
|
-
|
|
11930
|
-
|
|
11931
|
-
|
|
11932
|
-
|
|
11933
|
-
|
|
11934
|
-
|
|
11935
|
-
|
|
11936
|
-
|
|
11937
|
-
|
|
11873
|
+
// check the main program
|
|
11874
|
+
if (fields_changed_datasource) {
|
|
11875
|
+
const _session = SESSION_OBJ[SESSION_ID];
|
|
11876
|
+
const _ds = _session.DS_GLB[fields_changed_datasource];
|
|
11877
|
+
const prog_doc = await func.utils.DOCS_OBJ.get(SESSION_ID, _ds.prog_id);
|
|
11878
|
+
if (prog_doc.progUi) {
|
|
11879
|
+
validate_change(prog_doc, null, true);
|
|
11880
|
+
if (found) {
|
|
11881
|
+
const $elm = $(`#container_${_ds.prog_id}_0`);
|
|
11882
|
+
if ($elm?.length) {
|
|
11883
|
+
const elm_data = $elm.data();
|
|
11884
|
+
const $wrapper = $elm.parent();
|
|
11885
|
+
// const wrapper_data = $wrapper.data();
|
|
11886
|
+
const refreshed_ds = _ds.dsSession;
|
|
11887
|
+
|
|
11888
|
+
// let elm_to_delete = [];
|
|
11889
|
+
// const ts = Date.now();
|
|
11890
|
+
// $.each($elm.find('xu-root-component-' + SESSION_ID).find('*'), function (key, val) {
|
|
11891
|
+
// let xu_ui_id = $(val).attr('xu-ui-id');
|
|
11892
|
+
// if (xu_ui_id) {
|
|
11893
|
+
// let new_id = xu_ui_id + ts;
|
|
11894
|
+
// elm_to_delete.push(new_id);
|
|
11895
|
+
|
|
11896
|
+
// $(val).attr('xu-ui-id', new_id).removeData();
|
|
11897
|
+
// }
|
|
11898
|
+
// // else {
|
|
11899
|
+
// // $(val).remove();
|
|
11900
|
+
// // }
|
|
11901
|
+
// });
|
|
11902
|
+
|
|
11903
|
+
$elm.empty();
|
|
11904
|
+
if ($elm.data()) {
|
|
11905
|
+
const new_$div = await func.UI.screen.render_ui_tree(
|
|
11906
|
+
SESSION_ID,
|
|
11907
|
+
$elm, // the wrapper
|
|
11908
|
+
_.cloneDeep($elm.data().xuData.node), // the xu-panel node
|
|
11909
|
+
{},
|
|
11910
|
+
elm_data.xuData.paramsP, // the wrapper params
|
|
11911
|
+
null,
|
|
11912
|
+
null,
|
|
11913
|
+
elm_data.xuData.key, // the wrapper key
|
|
11914
|
+
refreshed_ds, // the refreshed_ds
|
|
11915
|
+
elm_data.xuData.parent_node, // the wrapper parent node
|
|
11916
|
+
null,
|
|
11917
|
+
elm_data.xuData.$root_container, // the wrapper root container
|
|
11918
|
+
);
|
|
11919
|
+
|
|
11920
|
+
// // remove old screen content
|
|
11921
|
+
// $.each(elm_to_delete, async function (key, val) {
|
|
11922
|
+
// $("[xu-ui-id='" + elm_to_delete + "']").remove();
|
|
11923
|
+
// });
|
|
11924
|
+
|
|
11925
|
+
if (_session.engine_mode === 'live_preview') {
|
|
11926
|
+
console.info('========= refresh main info ==============');
|
|
11927
|
+
console.info('reason:', refresh_reason);
|
|
11928
|
+
console.info('element:', $elm);
|
|
11929
|
+
console.info('==========================================');
|
|
11930
|
+
}
|
|
11931
|
+
|
|
11932
|
+
return;
|
|
11933
|
+
}
|
|
11934
|
+
}
|
|
11935
|
+
}
|
|
11936
|
+
}
|
|
11937
|
+
}
|
|
11938
11938
|
|
|
11939
11939
|
const panels_obj = await func.UI.utils.get_panels_wrapper_from_dom(SESSION_ID, $(SESSION_OBJ[SESSION_ID].root_element), false);
|
|
11940
11940
|
|
|
@@ -12016,169 +12016,168 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
|
|
|
12016
12016
|
}
|
|
12017
12017
|
};
|
|
12018
12018
|
|
|
12019
|
-
|
|
12020
|
-
//
|
|
12021
|
-
|
|
12022
|
-
|
|
12023
|
-
|
|
12024
|
-
|
|
12025
|
-
|
|
12026
|
-
|
|
12027
|
-
|
|
12028
|
-
|
|
12029
|
-
// }
|
|
12019
|
+
func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr, datasource_changed, fields_changed_datasource) {
|
|
12020
|
+
// check the main program
|
|
12021
|
+
if (fields_changed_datasource) {
|
|
12022
|
+
const _session = SESSION_OBJ[SESSION_ID];
|
|
12023
|
+
const _ds = _session.DS_GLB[fields_changed_datasource];
|
|
12024
|
+
const prog_doc = await func.utils.DOCS_OBJ.get(SESSION_ID, _ds.prog_id);
|
|
12025
|
+
const progDataSource_str = JSON.stringify(prog_doc.progDataSource);
|
|
12026
|
+
for (const field_id of fields_changed_arr || []) {
|
|
12027
|
+
}
|
|
12028
|
+
}
|
|
12030
12029
|
|
|
12031
|
-
|
|
12030
|
+
const panels_obj = await func.UI.utils.get_panels_wrapper_from_dom(SESSION_ID, $(SESSION_OBJ[SESSION_ID].root_element), false);
|
|
12032
12031
|
|
|
12033
|
-
|
|
12034
|
-
|
|
12032
|
+
for await (const [parent_element_ui_id, panel_val] of Object.entries(panels_obj)) {
|
|
12033
|
+
const progDataSource_str = JSON.stringify(panel_val.prog_doc.progDataSource);
|
|
12035
12034
|
|
|
12036
|
-
|
|
12037
|
-
|
|
12038
|
-
|
|
12039
|
-
|
|
12040
|
-
|
|
12041
|
-
|
|
12042
|
-
//
|
|
12043
|
-
|
|
12035
|
+
var found, refresh_reason, refresh_details;
|
|
12036
|
+
if (fields_changed_arr) {
|
|
12037
|
+
if (fields_changed_datasource && panel_val._ds.dsSession <= Number(fields_changed_datasource)) {
|
|
12038
|
+
continue;
|
|
12039
|
+
}
|
|
12040
|
+
for (const field_id of fields_changed_arr) {
|
|
12041
|
+
// get panel attributes
|
|
12042
|
+
const _attributes = panel_val?.panelXuAttributes || {};
|
|
12044
12043
|
|
|
12045
|
-
//
|
|
12046
|
-
|
|
12044
|
+
// detect if program changed
|
|
12045
|
+
found = _attributes['xu-exp:program']?.includes('@' + field_id);
|
|
12047
12046
|
|
|
12048
|
-
|
|
12049
|
-
|
|
12050
|
-
|
|
12051
|
-
|
|
12052
|
-
|
|
12047
|
+
if (found) {
|
|
12048
|
+
refresh_reason = `program ${_attributes['xu-exp:program']} ${field_id} changed `;
|
|
12049
|
+
refresh_details = _attributes;
|
|
12050
|
+
break;
|
|
12051
|
+
}
|
|
12053
12052
|
|
|
12054
|
-
//
|
|
12055
|
-
//
|
|
12056
|
-
|
|
12057
|
-
|
|
12058
|
-
|
|
12053
|
+
// _attributes holds also info of parameters in code_in: @code
|
|
12054
|
+
// search field changed in panel call send parameters exp
|
|
12055
|
+
for (const [attr, value] of Object.entries(_attributes)) {
|
|
12056
|
+
const pattern = /xu-exp:(\w+)/;
|
|
12057
|
+
const match = attr.match(pattern);
|
|
12059
12058
|
|
|
12060
|
-
|
|
12061
|
-
//
|
|
12062
|
-
|
|
12063
|
-
|
|
12064
|
-
//
|
|
12065
|
-
|
|
12066
|
-
//
|
|
12067
|
-
|
|
12068
|
-
//
|
|
12069
|
-
|
|
12059
|
+
if (!match) {
|
|
12060
|
+
// continue if attribute is not expression
|
|
12061
|
+
continue;
|
|
12062
|
+
}
|
|
12063
|
+
// code_in
|
|
12064
|
+
const parameter_in_field_id = match?.[1];
|
|
12065
|
+
// @code
|
|
12066
|
+
if (value.includes(field_id)) {
|
|
12067
|
+
// search parameter in field in the target program's progDataSource
|
|
12068
|
+
found = progDataSource_str?.includes('@' + parameter_in_field_id);
|
|
12070
12069
|
|
|
12071
|
-
|
|
12072
|
-
|
|
12073
|
-
|
|
12070
|
+
if (found) {
|
|
12071
|
+
refresh_reason = `field ${field_id} in progDataSource parameter_in changed`;
|
|
12072
|
+
refresh_details = panel_val?.prog_doc?.progDataSource;
|
|
12074
12073
|
|
|
12075
|
-
|
|
12076
|
-
|
|
12074
|
+
break;
|
|
12075
|
+
}
|
|
12077
12076
|
|
|
12078
|
-
//
|
|
12079
|
-
|
|
12077
|
+
// found = find_field_in_progUi(prog_doc.progUi, parameter_in_field_id, 'xu-for');
|
|
12078
|
+
found = func.UI.find_field_in_progUi_attributes(panel_val.prog_doc.progUi, parameter_in_field_id, 'xu-for').length;
|
|
12080
12079
|
|
|
12081
|
-
|
|
12082
|
-
|
|
12083
|
-
|
|
12080
|
+
if (found) {
|
|
12081
|
+
refresh_reason = `field ${field_id} in progUi xu-for parameter_in changed`;
|
|
12082
|
+
refresh_details = found;
|
|
12084
12083
|
|
|
12085
|
-
|
|
12086
|
-
|
|
12087
|
-
|
|
12088
|
-
|
|
12084
|
+
break;
|
|
12085
|
+
}
|
|
12086
|
+
}
|
|
12087
|
+
}
|
|
12089
12088
|
|
|
12090
|
-
|
|
12089
|
+
if (found) break;
|
|
12091
12090
|
|
|
12092
|
-
//
|
|
12093
|
-
|
|
12094
|
-
|
|
12095
|
-
|
|
12096
|
-
|
|
12091
|
+
// search field changed in the target program's progDataSource // @code
|
|
12092
|
+
found = progDataSource_str?.includes('@' + field_id);
|
|
12093
|
+
if (found) {
|
|
12094
|
+
refresh_reason = `field ${field_id} in progDataSource changed`;
|
|
12095
|
+
refresh_details = panel_val?.prog_doc?.progDataSource;
|
|
12097
12096
|
|
|
12098
|
-
|
|
12099
|
-
|
|
12097
|
+
break;
|
|
12098
|
+
}
|
|
12100
12099
|
|
|
12101
|
-
|
|
12102
|
-
|
|
12103
|
-
|
|
12104
|
-
|
|
12100
|
+
found = func.UI.find_field_in_progUi_attributes(panel_val.prog_doc.progUi, field_id, 'xu-for').length;
|
|
12101
|
+
if (found) {
|
|
12102
|
+
refresh_reason = `field ${field_id} in progUi xu-for changed`;
|
|
12103
|
+
refresh_details = found;
|
|
12105
12104
|
|
|
12106
|
-
|
|
12107
|
-
|
|
12105
|
+
break;
|
|
12106
|
+
}
|
|
12108
12107
|
|
|
12109
|
-
|
|
12110
|
-
|
|
12111
|
-
|
|
12112
|
-
|
|
12113
|
-
|
|
12108
|
+
if (found) {
|
|
12109
|
+
break;
|
|
12110
|
+
}
|
|
12111
|
+
}
|
|
12112
|
+
}
|
|
12114
12113
|
|
|
12115
|
-
|
|
12116
|
-
|
|
12117
|
-
|
|
12118
|
-
|
|
12114
|
+
if (datasource_changed) {
|
|
12115
|
+
if (panel_val._ds.dsSession == datasource_changed) {
|
|
12116
|
+
refresh_reason = `panel datasource ${datasource_changed} changed`;
|
|
12117
|
+
refresh_details = '';
|
|
12119
12118
|
|
|
12120
|
-
|
|
12121
|
-
|
|
12122
|
-
|
|
12123
|
-
|
|
12124
|
-
|
|
12125
|
-
|
|
12126
|
-
|
|
12127
|
-
|
|
12128
|
-
|
|
12129
|
-
|
|
12130
|
-
|
|
12131
|
-
|
|
12132
|
-
|
|
12133
|
-
|
|
12119
|
+
found = true;
|
|
12120
|
+
}
|
|
12121
|
+
}
|
|
12122
|
+
if (found) {
|
|
12123
|
+
const _session = SESSION_OBJ[SESSION_ID];
|
|
12124
|
+
if (_session.engine_mode === 'live_preview') {
|
|
12125
|
+
console.info('========= refresh info ==============');
|
|
12126
|
+
console.info('reason:', refresh_reason);
|
|
12127
|
+
console.info('details:', refresh_details);
|
|
12128
|
+
console.info('panel:', panel_val);
|
|
12129
|
+
console.info('=====================================');
|
|
12130
|
+
}
|
|
12131
|
+
const $div_elm = panel_val.$panel_div;
|
|
12132
|
+
const wrapper_data = $div_elm.data();
|
|
12134
12133
|
|
|
12135
|
-
|
|
12134
|
+
if (_.isEmpty(wrapper_data)) continue;
|
|
12136
12135
|
|
|
12137
|
-
|
|
12138
|
-
|
|
12139
|
-
//
|
|
12140
|
-
|
|
12141
|
-
|
|
12142
|
-
|
|
12143
|
-
|
|
12144
|
-
|
|
12136
|
+
try {
|
|
12137
|
+
const ts = Date.now();
|
|
12138
|
+
// remove old panel content
|
|
12139
|
+
$.each(panel_val.ids, async function (key, val) {
|
|
12140
|
+
$("[xu-ui-id='" + val + "']")
|
|
12141
|
+
.attr('xu-ui-id', val + ts)
|
|
12142
|
+
.removeData();
|
|
12143
|
+
});
|
|
12145
12144
|
|
|
12146
|
-
|
|
12147
|
-
//
|
|
12145
|
+
let refreshed_ds;
|
|
12146
|
+
// check if ds exist and deleted by garbage collector
|
|
12148
12147
|
|
|
12149
|
-
|
|
12150
|
-
|
|
12151
|
-
|
|
12152
|
-
|
|
12153
|
-
|
|
12148
|
+
if (_session.DS_GLB[panel_val._ds.dsSession]) {
|
|
12149
|
+
refreshed_ds = panel_val._ds.dsSession;
|
|
12150
|
+
}
|
|
12151
|
+
for await (const item of wrapper_data.xuData.node_org.children) {
|
|
12152
|
+
if (item.tagName !== 'xu-panel') continue;
|
|
12154
12153
|
|
|
12155
|
-
|
|
12156
|
-
|
|
12157
|
-
|
|
12158
|
-
|
|
12159
|
-
|
|
12160
|
-
|
|
12161
|
-
|
|
12162
|
-
|
|
12163
|
-
|
|
12164
|
-
|
|
12165
|
-
|
|
12166
|
-
|
|
12167
|
-
|
|
12168
|
-
|
|
12169
|
-
|
|
12154
|
+
const new_$div = await func.UI.screen.render_ui_tree(
|
|
12155
|
+
SESSION_ID,
|
|
12156
|
+
$div_elm, // the wrapper
|
|
12157
|
+
_.cloneDeep(item), // _.cloneDeep(wrapper_data.xuData.node_org.children[0]), // the xu-panel node
|
|
12158
|
+
{},
|
|
12159
|
+
wrapper_data.xuData.paramsP, // the wrapper params
|
|
12160
|
+
null,
|
|
12161
|
+
null,
|
|
12162
|
+
wrapper_data.xuData.key, // the wrapper key
|
|
12163
|
+
refreshed_ds, // the refreshed_ds
|
|
12164
|
+
wrapper_data.xuData.parent_node, // the wrapper parent node
|
|
12165
|
+
null,
|
|
12166
|
+
wrapper_data.xuData.$root_container, // the wrapper root container
|
|
12167
|
+
);
|
|
12168
|
+
}
|
|
12170
12169
|
|
|
12171
|
-
//
|
|
12172
|
-
|
|
12173
|
-
|
|
12174
|
-
|
|
12175
|
-
|
|
12176
|
-
|
|
12177
|
-
|
|
12178
|
-
//
|
|
12179
|
-
|
|
12180
|
-
|
|
12181
|
-
|
|
12170
|
+
// remove old panel content
|
|
12171
|
+
$.each(panel_val.ids, async function (key, val) {
|
|
12172
|
+
$("[xu-ui-id='" + val + ts + "']").remove();
|
|
12173
|
+
});
|
|
12174
|
+
} catch (error) {
|
|
12175
|
+
debugger;
|
|
12176
|
+
}
|
|
12177
|
+
// continue;
|
|
12178
|
+
}
|
|
12179
|
+
}
|
|
12180
|
+
};
|
|
12182
12181
|
|
|
12183
12182
|
const get_params_obj_new = async function (SESSION_ID, prog_id, nodeP, dsSession) {
|
|
12184
12183
|
const _prog = await func.utils.VIEWS_OBJ.get(SESSION_ID, prog_id);
|