@xuda.io/runtime-bundle 1.0.608 → 1.0.609
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 +122 -1583
- package/js/xuda-runtime-bundle.min.js +1 -1
- package/js/xuda-runtime-slim.js +122 -1583
- package/js/xuda-runtime-slim.min.es.js +121 -167
- package/js/xuda-runtime-slim.min.js +1 -1
- package/package.json +1 -1
|
@@ -8501,40 +8501,40 @@ func.UI.utils.init_ui_framework = async function (SESSION_ID, prog_id) {
|
|
|
8501
8501
|
}
|
|
8502
8502
|
};
|
|
8503
8503
|
// old
|
|
8504
|
-
func.UI.utils.get_panels_from_dom = function (SESSION_ID, ignore_disableAutoRefresh) {
|
|
8505
|
-
|
|
8506
|
-
|
|
8504
|
+
// func.UI.utils.get_panels_from_dom = function (SESSION_ID, ignore_disableAutoRefresh) {
|
|
8505
|
+
// const $elm = func.UI.utils.find_in_element_data('xuPanelData', $(SESSION_OBJ[SESSION_ID].root_element), 'parent_element_ui_id');
|
|
8506
|
+
// var panels_obj = {};
|
|
8507
8507
|
|
|
8508
|
-
|
|
8509
|
-
|
|
8510
|
-
|
|
8511
|
-
|
|
8512
|
-
|
|
8508
|
+
// // set panels_obj
|
|
8509
|
+
// for (const [elem_key, elem_val] of Object.entries($elm)) {
|
|
8510
|
+
// if (elem_key === 'length') break;
|
|
8511
|
+
// var $div = $(elem_val);
|
|
8512
|
+
// let xuData = $div.data().xuData;
|
|
8513
8513
|
|
|
8514
|
-
|
|
8514
|
+
// if (!$div.data().xuPanelData) continue;
|
|
8515
8515
|
|
|
8516
|
-
|
|
8517
|
-
|
|
8518
|
-
|
|
8519
|
-
|
|
8516
|
+
// let dsSession = xuData.paramsP.dsSessionP;
|
|
8517
|
+
// var _session = SESSION_OBJ[SESSION_ID];
|
|
8518
|
+
// let _ds = _session?.DS_GLB[dsSession];
|
|
8519
|
+
// if (!_ds) continue;
|
|
8520
8520
|
|
|
8521
|
-
|
|
8522
|
-
|
|
8523
|
-
|
|
8521
|
+
// if (!ignore_disableAutoRefresh && _ds.tree_obj.disableAutoRefresh) {
|
|
8522
|
+
// continue;
|
|
8523
|
+
// }
|
|
8524
8524
|
|
|
8525
|
-
|
|
8526
|
-
|
|
8527
|
-
|
|
8528
|
-
|
|
8529
|
-
|
|
8530
|
-
|
|
8531
|
-
|
|
8532
|
-
|
|
8533
|
-
|
|
8534
|
-
|
|
8525
|
+
// const parent_element_ui_id = $div.data().xuPanelData.parent_element_ui_id;
|
|
8526
|
+
// if (!panels_obj[parent_element_ui_id]) {
|
|
8527
|
+
// panels_obj[parent_element_ui_id] = {
|
|
8528
|
+
// _ds,
|
|
8529
|
+
// $div,
|
|
8530
|
+
// ids: [],
|
|
8531
|
+
// };
|
|
8532
|
+
// }
|
|
8533
|
+
// panels_obj[parent_element_ui_id].ids.push($div.attr('xu-ui-id'));
|
|
8534
|
+
// }
|
|
8535
8535
|
|
|
8536
|
-
|
|
8537
|
-
};
|
|
8536
|
+
// return panels_obj;
|
|
8537
|
+
// };
|
|
8538
8538
|
|
|
8539
8539
|
func.UI.utils.get_panels_wrapper_from_dom = async function (SESSION_ID, $xu_embed_container, ignore_disableAutoRefresh) {
|
|
8540
8540
|
const $elm = func.UI.utils.find_in_element_data('xuPanelWrapper', $(SESSION_OBJ[SESSION_ID].root_element), 'isWrapper');
|
|
@@ -9641,31 +9641,6 @@ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, j
|
|
|
9641
9641
|
const _elem_val = { attributes: [], $elm: _$elem };
|
|
9642
9642
|
if (!_$elem?.length) continue;
|
|
9643
9643
|
|
|
9644
|
-
// if (!_$elem?.length) {
|
|
9645
|
-
// // xu-for may exist in the panel root
|
|
9646
|
-
// if (!panel_wrapper_element_ui_id) continue;
|
|
9647
|
-
|
|
9648
|
-
// $.each(item.attributes, function (key, val) {
|
|
9649
|
-
// _elem_val.attributes.push(key);
|
|
9650
|
-
// });
|
|
9651
|
-
// // _$elem = $(`[xu-ui-id="${panel_wrapper_element}"]`);
|
|
9652
|
-
// await func.UI.worker.add_to_queue(
|
|
9653
|
-
// SESSION_ID,
|
|
9654
|
-
// 'gui event',
|
|
9655
|
-
// 'execute_xu_for',
|
|
9656
|
-
// {
|
|
9657
|
-
// ui_type: _elem_val.$elm.data().xuData.ui_type,
|
|
9658
|
-
// SESSION_ID,
|
|
9659
|
-
// elem_key: _elem_key,
|
|
9660
|
-
// elem_val: _elem_val,
|
|
9661
|
-
// fields_arr,
|
|
9662
|
-
// },
|
|
9663
|
-
// new_job,
|
|
9664
|
-
// _elem_val.$elm,
|
|
9665
|
-
// _elem_val.$elm.data().xuData.paramsP.dsSessionP,
|
|
9666
|
-
// );
|
|
9667
|
-
// }
|
|
9668
|
-
|
|
9669
9644
|
if (refreshed_ids.includes(_$elem.attr('xu-ui-id'))) break;
|
|
9670
9645
|
|
|
9671
9646
|
$.each(_$elem.data()?.xuAttributes, function (key, val) {
|
|
@@ -9703,7 +9678,6 @@ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, j
|
|
|
9703
9678
|
|
|
9704
9679
|
const $xu_embed_container = $('.xu_embed_container');
|
|
9705
9680
|
const panels_obj = await func.UI.utils.get_panels_wrapper_from_dom(SESSION_ID, $xu_embed_container, true);
|
|
9706
|
-
// let inviable_panels_obj = {};
|
|
9707
9681
|
|
|
9708
9682
|
for await (const field_id of fields_arr) {
|
|
9709
9683
|
// run root
|
|
@@ -9711,29 +9685,12 @@ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, j
|
|
|
9711
9685
|
const progUi = $xu_embed_container?.data()?.xuData?.screenInfo?.progUi;
|
|
9712
9686
|
if (progUi) {
|
|
9713
9687
|
await iterate_field_in_progUi(progUi, field_id);
|
|
9714
|
-
// // find invisible panels
|
|
9715
|
-
// const inviable_panels_arr = func.UI.find_field_in_progUi_attributes(progUi, field_id, null, 'xu-panel');
|
|
9716
|
-
// console.log('inviable_panels_arr', inviable_panels_arr);
|
|
9717
|
-
// let prog_id = elm_node?.attributes?.program;
|
|
9718
|
-
// const exp = elm_node?.attributes?.['xu-exp:program'];
|
|
9719
|
-
// if (exp) {
|
|
9720
|
-
// let exp_ret = await func.expression.get(SESSION_ID, exp, $xu_embed_container?.data()?.xuData?.paramsP?.dsSessionP, 'UI Attr EXP');
|
|
9721
|
-
// prog_id = func.UI.screen.fix_val_defaults('program', exp_ret.result);
|
|
9722
|
-
// inviable_panels_obj[elm_node.id] = { prog_id };
|
|
9723
|
-
// }
|
|
9724
9688
|
}
|
|
9725
9689
|
}
|
|
9726
9690
|
// run panels
|
|
9727
9691
|
for await (const [panel_wrapper_element_ui_id, panel_val] of Object.entries(panels_obj)) {
|
|
9728
|
-
// const prog_doc = await func.utils.DOCS_OBJ.get(SESSION_ID, panel_val.prog_id);
|
|
9729
9692
|
await iterate_field_in_progUi(panel_val.progUi, field_id);
|
|
9730
9693
|
}
|
|
9731
|
-
|
|
9732
|
-
// // run invisible panels
|
|
9733
|
-
// for await (const [parent_element_ui_id, panel_val] of Object.entries(inviable_panels_obj)) {
|
|
9734
|
-
// const prog_doc = await func.utils.DOCS_OBJ.get(SESSION_ID, panel_val.prog_id);
|
|
9735
|
-
// await iterate_field_in_progUi(prog_doc.progUi, field_id);
|
|
9736
|
-
// }
|
|
9737
9694
|
}
|
|
9738
9695
|
|
|
9739
9696
|
func.events.delete_job(SESSION_ID, jobNoP);
|
|
@@ -9751,9 +9708,6 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
|
|
|
9751
9708
|
|
|
9752
9709
|
var found, refresh_reason, refresh_details;
|
|
9753
9710
|
if (fields_changed_arr) {
|
|
9754
|
-
// if (fields_changed_datasource && panel_val._ds.dsSession < fields_changed_datasource) {
|
|
9755
|
-
// continue;
|
|
9756
|
-
// }
|
|
9757
9711
|
if (fields_changed_datasource && panel_val._ds.dsSession <= Number(fields_changed_datasource)) {
|
|
9758
9712
|
continue;
|
|
9759
9713
|
}
|
|
@@ -9854,43 +9808,43 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
|
|
|
9854
9808
|
if (_.isEmpty(wrapper_data)) continue;
|
|
9855
9809
|
|
|
9856
9810
|
try {
|
|
9857
|
-
// const panelDivData = panel_val.$panel_div.data().xuPanelWrapper.panelDivData;
|
|
9858
9811
|
const ts = Date.now();
|
|
9859
9812
|
// remove old panel content
|
|
9860
9813
|
$.each(panel_val.ids, async function (key, val) {
|
|
9861
9814
|
$("[xu-ui-id='" + val + "']")
|
|
9862
9815
|
.attr('xu-ui-id', val + ts)
|
|
9863
9816
|
.removeData();
|
|
9864
|
-
// .css('filter', 'blur(1px)');
|
|
9865
9817
|
});
|
|
9866
9818
|
|
|
9867
9819
|
let refreshed_ds;
|
|
9868
9820
|
// check if ds exist and deleted by garbage collector
|
|
9869
9821
|
|
|
9870
|
-
// const _session = SESSION_OBJ[SESSION_ID];
|
|
9871
9822
|
if (_session.DS_GLB[panel_val._ds.dsSession]) {
|
|
9872
9823
|
refreshed_ds = panel_val._ds.dsSession;
|
|
9873
9824
|
}
|
|
9825
|
+
for await (item of wrapper_data.xuData.node_org.children) {
|
|
9826
|
+
if (item.tagName !== 'xu-render') continue;
|
|
9874
9827
|
|
|
9875
|
-
|
|
9876
|
-
|
|
9877
|
-
|
|
9878
|
-
|
|
9879
|
-
|
|
9880
|
-
|
|
9881
|
-
|
|
9882
|
-
|
|
9883
|
-
|
|
9884
|
-
|
|
9885
|
-
|
|
9886
|
-
|
|
9887
|
-
|
|
9888
|
-
|
|
9828
|
+
const new_$div = await func.UI.screen.render_ui_tree(
|
|
9829
|
+
SESSION_ID,
|
|
9830
|
+
$div_elm, // the wrapper
|
|
9831
|
+
_.cloneDeep(item), // _.cloneDeep(wrapper_data.xuData.node_org.children[0]), // the xu-panel node
|
|
9832
|
+
{},
|
|
9833
|
+
wrapper_data.xuData.paramsP, // the wrapper params
|
|
9834
|
+
null,
|
|
9835
|
+
null,
|
|
9836
|
+
wrapper_data.xuData.key, // the wrapper key
|
|
9837
|
+
refreshed_ds, // the refreshed_ds
|
|
9838
|
+
wrapper_data.xuData.parent_node, // the wrapper parent node
|
|
9839
|
+
null,
|
|
9840
|
+
wrapper_data.xuData.$root_container, // the wrapper root container
|
|
9841
|
+
);
|
|
9889
9842
|
|
|
9890
|
-
|
|
9891
|
-
|
|
9892
|
-
|
|
9893
|
-
|
|
9843
|
+
// remove old panel content
|
|
9844
|
+
$.each(panel_val.ids, async function (key, val) {
|
|
9845
|
+
$("[xu-ui-id='" + val + ts + "']").remove();
|
|
9846
|
+
});
|
|
9847
|
+
}
|
|
9894
9848
|
} catch (error) {
|
|
9895
9849
|
debugger;
|
|
9896
9850
|
}
|
|
@@ -9899,86 +9853,86 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
|
|
|
9899
9853
|
}
|
|
9900
9854
|
};
|
|
9901
9855
|
|
|
9902
|
-
func.UI.screen.refresh_screen_old = async function (SESSION_ID, fields_changed_arr, datasource_changed, fields_changed_datasource) {
|
|
9903
|
-
|
|
9904
|
-
|
|
9905
|
-
for await (const [parent_element_ui_id, panel_val] of Object.entries(panels_obj)) {
|
|
9906
|
-
const prog_doc = await func.utils.DOCS_OBJ.get(SESSION_ID, panel_val._ds.prog_id);
|
|
9907
|
-
const progDataSource_str = JSON.stringify(prog_doc.progDataSource);
|
|
9908
|
-
|
|
9909
|
-
var found;
|
|
9910
|
-
if (fields_changed_arr) {
|
|
9911
|
-
if (fields_changed_datasource && panel_val._ds.dsSession < fields_changed_datasource) {
|
|
9912
|
-
continue;
|
|
9913
|
-
}
|
|
9914
|
-
for (const field_id of fields_changed_arr) {
|
|
9915
|
-
// get panel attributes
|
|
9916
|
-
const _attributes = panel_val?.$div?.data()?.xuPanelData?.node?.attributes || {};
|
|
9917
|
-
|
|
9918
|
-
// detect if program changed
|
|
9919
|
-
found = _attributes['xu-exp:program']?.includes('@' + field_id);
|
|
9920
|
-
if (found) break;
|
|
9921
|
-
|
|
9922
|
-
// _attributes holds also info of parameters in code_in: @code
|
|
9923
|
-
// search field changed in panel call send parameters exp
|
|
9924
|
-
for (const [attr, value] of Object.entries(_attributes)) {
|
|
9925
|
-
const pattern = /xu-exp:(\w+)/;
|
|
9926
|
-
const match = attr.match(pattern);
|
|
9856
|
+
// func.UI.screen.refresh_screen_old = async function (SESSION_ID, fields_changed_arr, datasource_changed, fields_changed_datasource) {
|
|
9857
|
+
// const panels_obj = func.UI.utils.get_panels_from_dom(SESSION_ID, false);
|
|
9927
9858
|
|
|
9928
|
-
|
|
9929
|
-
|
|
9930
|
-
|
|
9931
|
-
}
|
|
9932
|
-
// code_in
|
|
9933
|
-
const parameter_in_field_id = match?.[1];
|
|
9934
|
-
// @code
|
|
9935
|
-
if (value.includes(field_id)) {
|
|
9936
|
-
// search parameter in field in the target program's progDataSource
|
|
9937
|
-
found = progDataSource_str?.includes('@' + parameter_in_field_id);
|
|
9938
|
-
if (found) break;
|
|
9859
|
+
// for await (const [parent_element_ui_id, panel_val] of Object.entries(panels_obj)) {
|
|
9860
|
+
// const prog_doc = await func.utils.DOCS_OBJ.get(SESSION_ID, panel_val._ds.prog_id);
|
|
9861
|
+
// const progDataSource_str = JSON.stringify(prog_doc.progDataSource);
|
|
9939
9862
|
|
|
9940
|
-
|
|
9941
|
-
|
|
9942
|
-
|
|
9943
|
-
|
|
9944
|
-
|
|
9863
|
+
// var found;
|
|
9864
|
+
// if (fields_changed_arr) {
|
|
9865
|
+
// if (fields_changed_datasource && panel_val._ds.dsSession < fields_changed_datasource) {
|
|
9866
|
+
// continue;
|
|
9867
|
+
// }
|
|
9868
|
+
// for (const field_id of fields_changed_arr) {
|
|
9869
|
+
// // get panel attributes
|
|
9870
|
+
// const _attributes = panel_val?.$div?.data()?.xuPanelData?.node?.attributes || {};
|
|
9871
|
+
|
|
9872
|
+
// // detect if program changed
|
|
9873
|
+
// found = _attributes['xu-exp:program']?.includes('@' + field_id);
|
|
9874
|
+
// if (found) break;
|
|
9875
|
+
|
|
9876
|
+
// // _attributes holds also info of parameters in code_in: @code
|
|
9877
|
+
// // search field changed in panel call send parameters exp
|
|
9878
|
+
// for (const [attr, value] of Object.entries(_attributes)) {
|
|
9879
|
+
// const pattern = /xu-exp:(\w+)/;
|
|
9880
|
+
// const match = attr.match(pattern);
|
|
9881
|
+
|
|
9882
|
+
// if (!match) {
|
|
9883
|
+
// // continue if attribute is not expression
|
|
9884
|
+
// continue;
|
|
9885
|
+
// }
|
|
9886
|
+
// // code_in
|
|
9887
|
+
// const parameter_in_field_id = match?.[1];
|
|
9888
|
+
// // @code
|
|
9889
|
+
// if (value.includes(field_id)) {
|
|
9890
|
+
// // search parameter in field in the target program's progDataSource
|
|
9891
|
+
// found = progDataSource_str?.includes('@' + parameter_in_field_id);
|
|
9892
|
+
// if (found) break;
|
|
9893
|
+
|
|
9894
|
+
// // found = find_field_in_progUi(prog_doc.progUi, parameter_in_field_id, 'xu-for');
|
|
9895
|
+
// found = func.UI.find_field_in_progUi_attributes(prog_doc.progUi, parameter_in_field_id, 'xu-for').length;
|
|
9896
|
+
// if (found) break;
|
|
9897
|
+
// }
|
|
9898
|
+
// }
|
|
9945
9899
|
|
|
9946
|
-
|
|
9900
|
+
// if (found) break;
|
|
9947
9901
|
|
|
9948
|
-
|
|
9949
|
-
|
|
9950
|
-
|
|
9951
|
-
|
|
9952
|
-
|
|
9902
|
+
// // search field changed in the target program's progDataSource // @code
|
|
9903
|
+
// found = progDataSource_str?.includes('@' + field_id);
|
|
9904
|
+
// if (found) break;
|
|
9905
|
+
// }
|
|
9906
|
+
// }
|
|
9953
9907
|
|
|
9954
|
-
|
|
9955
|
-
|
|
9956
|
-
|
|
9957
|
-
|
|
9958
|
-
|
|
9959
|
-
|
|
9960
|
-
|
|
9961
|
-
|
|
9962
|
-
|
|
9963
|
-
|
|
9908
|
+
// if (datasource_changed) {
|
|
9909
|
+
// if (panel_val._ds.dsSession == datasource_changed) {
|
|
9910
|
+
// found = true;
|
|
9911
|
+
// }
|
|
9912
|
+
// }
|
|
9913
|
+
// if (found) {
|
|
9914
|
+
// var $div_elm = panel_val.$div
|
|
9915
|
+
// .parent()
|
|
9916
|
+
// .parent()
|
|
9917
|
+
// .find("[xu-ui-id='" + parent_element_ui_id + "']");
|
|
9964
9918
|
|
|
9965
|
-
|
|
9966
|
-
|
|
9967
|
-
|
|
9919
|
+
// // restore original panel
|
|
9920
|
+
// try {
|
|
9921
|
+
// // const $org_panel = panel_val.$div.data().xuPanelData.$panel_div;
|
|
9968
9922
|
|
|
9969
|
-
|
|
9923
|
+
// const new_$div = await func.UI.screen.render_ui_tree(SESSION_ID, $div_elm, _.cloneDeep(panel_val.$div.data().xuPanelData.node), {}, $div_elm.data().xuData.paramsP, null, null, $div_elm.data().xuData.key, null, $div_elm.data().xuData.parent_node, null, $div_elm.data().xuData.$root_container);
|
|
9970
9924
|
|
|
9971
|
-
|
|
9972
|
-
|
|
9973
|
-
|
|
9974
|
-
|
|
9975
|
-
|
|
9976
|
-
|
|
9977
|
-
|
|
9978
|
-
|
|
9979
|
-
|
|
9980
|
-
|
|
9981
|
-
};
|
|
9925
|
+
// // remove old panel content
|
|
9926
|
+
// $.each(panel_val.ids, async function (key, val) {
|
|
9927
|
+
// $("[xu-ui-id='" + val + "']").remove();
|
|
9928
|
+
// });
|
|
9929
|
+
// } catch (error) {
|
|
9930
|
+
// debugger;
|
|
9931
|
+
// }
|
|
9932
|
+
// break;
|
|
9933
|
+
// }
|
|
9934
|
+
// }
|
|
9935
|
+
// };
|
|
9982
9936
|
|
|
9983
9937
|
// const get_params_obj = async function (SESSION_ID, prog_id, parameters_obj_inP) {
|
|
9984
9938
|
// const _prog = await func.utils.VIEWS_OBJ.get(SESSION_ID, prog_id);
|