@xuda.io/runtime-bundle 1.0.879 → 1.0.881
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 +22 -543
- package/js/xuda-runtime-bundle.min.js +3 -3
- package/js/xuda-runtime-slim.js +22 -543
- package/js/xuda-runtime-slim.min.es.js +22 -543
- package/js/xuda-runtime-slim.min.js +3 -3
- package/js/xuda-server-bundle.min.mjs +1 -1
- package/js/xuda-server-bundle.mjs +9 -28
- package/js/xuda-worker-bundle.js +9 -28
- package/js/xuda-worker-bundle.min.js +1 -1
- package/package.json +1 -1
|
@@ -27549,43 +27549,19 @@ func.UI.worker.init = async function (SESSION_ID) {
|
|
|
27549
27549
|
break;
|
|
27550
27550
|
}
|
|
27551
27551
|
|
|
27552
|
-
// var _session = SESSION_OBJ[val.SESSION_ID];
|
|
27553
|
-
// if (!UI_WORKER_OBJ.jobs[Number(key)] || val.job_num === 9999999)
|
|
27554
|
-
// continue;
|
|
27555
|
-
|
|
27556
|
-
// if (val.dsSessionP && !_session.DS_GLB[val.dsSessionP]) {
|
|
27557
|
-
// func.UI.worker.delete_job(val.SESSION_ID, val.job_num);
|
|
27558
|
-
// continue;
|
|
27559
|
-
// }
|
|
27560
|
-
|
|
27561
|
-
// if (val?.elementP && !val.elementP.isInViewport()) {
|
|
27562
|
-
// continue;
|
|
27563
|
-
// }
|
|
27564
|
-
|
|
27565
27552
|
await func.UI.worker.execute(val.SESSION_ID, val);
|
|
27566
27553
|
// break;
|
|
27567
27554
|
} catch (err) {
|
|
27568
27555
|
console.error(err);
|
|
27569
27556
|
}
|
|
27570
27557
|
}
|
|
27571
|
-
// setTimeout(job_iterator, 1);
|
|
27572
27558
|
}
|
|
27573
27559
|
} else {
|
|
27574
27560
|
//busy
|
|
27575
27561
|
|
|
27576
27562
|
this.attempt++;
|
|
27577
27563
|
}
|
|
27578
|
-
// return job_iterator();
|
|
27579
|
-
// run_stat = 0;
|
|
27580
27564
|
};
|
|
27581
|
-
// job_iterator();
|
|
27582
|
-
// this._interval = setInterval(() => {
|
|
27583
|
-
// if (!run_stat) {
|
|
27584
|
-
// var testId = crypto.randomUUID();
|
|
27585
|
-
// run_stat = 1;
|
|
27586
|
-
// job_iterator(testId);
|
|
27587
|
-
// }
|
|
27588
|
-
// }, 10);
|
|
27589
27565
|
|
|
27590
27566
|
this._interval = setInterval(job_iterator, 1);
|
|
27591
27567
|
|
|
@@ -27858,24 +27834,8 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
|
|
|
27858
27834
|
for await (const [key, val] of Object.entries(nodeP.children)) {
|
|
27859
27835
|
const ret = await func.UI.screen.render_ui_tree(SESSION_ID, $div, nodeP.children[key], parent_infoP, paramsP, jobNoP, is_skeleton, Number(key), null, nodeP, null, $root_container);
|
|
27860
27836
|
}
|
|
27861
|
-
|
|
27862
|
-
// const parent_id = $div.parent().attr('xu-ui-id');
|
|
27863
|
-
// if (!UI_WORKER_OBJ.viewport_height_set_ids.includes(parent_id)) {
|
|
27864
|
-
// UI_WORKER_OBJ.viewport_height_set_ids.push(parent_id);
|
|
27865
|
-
// func.UI.worker.add_to_queue(SESSION_ID, 'gui event', 'set_viewport_height', { $elm: $div.parent(), height: $div.height() }, null, null, paramsP.dsSessionP);
|
|
27866
|
-
// }
|
|
27867
|
-
|
|
27868
|
-
// if ($div.hasClass('viewport_height')) {
|
|
27869
|
-
// $div.css('height', 'unset');
|
|
27870
|
-
// }
|
|
27871
|
-
|
|
27872
|
-
// const height = $div.data().xuData.viewport_height;
|
|
27873
|
-
// if (typeof height !== 'undefined') {
|
|
27874
|
-
// $div.css('height', 'unset');
|
|
27875
|
-
// } else {
|
|
27837
|
+
$div[0].style.removeProperty('height');
|
|
27876
27838
|
$div.data().xuData.viewport_height = $div.height();
|
|
27877
|
-
// func.UI.worker.add_to_queue(SESSION_ID, 'gui event', 'set_viewport_height', { $elm: $div.parent(), height: $div.height() }, null, null, paramsP.dsSessionP);
|
|
27878
|
-
// }
|
|
27879
27839
|
|
|
27880
27840
|
// set initial default height for all children
|
|
27881
27841
|
const parent_id = $div.parent().attr('xu-ui-id');
|
|
@@ -27890,12 +27850,9 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
|
|
|
27890
27850
|
set_viewport_height: async function () {
|
|
27891
27851
|
const { $div, height } = queue_obj?.paramsP || {};
|
|
27892
27852
|
|
|
27893
|
-
// $elm.data().xuData.viewport_height = $div.height();
|
|
27894
|
-
|
|
27895
27853
|
$.each($div.parent().children(), function (key, elm) {
|
|
27896
27854
|
if (!$(elm)[0].style.height && !$(elm).children().length) {
|
|
27897
|
-
$(elm).css('height', height);
|
|
27898
|
-
// $(elm).data().xuData.viewport_height = $div.height();
|
|
27855
|
+
$(elm).css('height', height);
|
|
27899
27856
|
}
|
|
27900
27857
|
});
|
|
27901
27858
|
|
|
@@ -30883,7 +30840,7 @@ func.datasource.update_changes_for_out_parameter = async function (SESSION_ID, d
|
|
|
30883
30840
|
let _session = SESSION_OBJ[SESSION_ID];
|
|
30884
30841
|
let _ds = _session.DS_GLB[dsSessionP];
|
|
30885
30842
|
const _calling_ds = _session.DS_GLB[calling_dsP];
|
|
30886
|
-
|
|
30843
|
+
|
|
30887
30844
|
if (_ds.PARAM_OUT_INFO) {
|
|
30888
30845
|
let data = {};
|
|
30889
30846
|
for await (const [key, val] of Object.entries(_ds.PARAM_OUT_INFO)) {
|
|
@@ -31067,115 +31024,15 @@ func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callin
|
|
|
31067
31024
|
$rootFrame.css('display', 'contents');
|
|
31068
31025
|
}
|
|
31069
31026
|
|
|
31070
|
-
// ////////// skeleton
|
|
31071
|
-
|
|
31072
31027
|
var node = JSON.parse(JSON.stringify(screen_ret.progUi));
|
|
31073
31028
|
|
|
31074
|
-
// const change_tree_to_skeleton = (node) => {
|
|
31075
|
-
// var tags = ["input", "button", "li", "xu-panel"];
|
|
31076
|
-
// $.each(node.children, (key, val) => {
|
|
31077
|
-
// if (val.type !== "element") return true;
|
|
31078
|
-
|
|
31079
|
-
// if (val.attributes) {
|
|
31080
|
-
// delete val.attributes.placeholder;
|
|
31081
|
-
|
|
31082
|
-
// var class_skeleton = "";
|
|
31083
|
-
|
|
31084
|
-
// if (tags.includes(val.tagName) || !val.children.length) {
|
|
31085
|
-
// class_skeleton = "skeleton";
|
|
31086
|
-
// }
|
|
31087
|
-
// if (class_skeleton) {
|
|
31088
|
-
// if (val.attributes?.class) {
|
|
31089
|
-
// val.attributes.class += ` ${class_skeleton}`;
|
|
31090
|
-
// } else {
|
|
31091
|
-
// val.attributes.class = class_skeleton;
|
|
31092
|
-
// }
|
|
31093
|
-
// if (val.tagName === "xu-panel") {
|
|
31094
|
-
// val.tagName = "div";
|
|
31095
|
-
// val.attributes.class += " skeleton-panel";
|
|
31096
|
-
// }
|
|
31097
|
-
// }
|
|
31098
|
-
// change_tree_to_skeleton(val);
|
|
31099
|
-
// }
|
|
31100
|
-
// });
|
|
31101
|
-
// };
|
|
31102
|
-
// if (!is_panelP) {
|
|
31103
|
-
// change_tree_to_skeleton(node[0]);
|
|
31104
|
-
|
|
31105
|
-
// const $skeleton_wrapper = $("<div class='skeleton_wrapper'>");
|
|
31106
|
-
// const ret_skelton = await func.UI.screen.render_ui_tree(
|
|
31107
|
-
// SESSION_ID,
|
|
31108
|
-
// $skeleton_wrapper,
|
|
31109
|
-
// node[0].children[0],
|
|
31110
|
-
// {},
|
|
31111
|
-
// params,
|
|
31112
|
-
// jobNoP,
|
|
31113
|
-
// true,
|
|
31114
|
-
// 0,
|
|
31115
|
-
// null,
|
|
31116
|
-
// node,
|
|
31117
|
-
// null,
|
|
31118
|
-
// $rootFrame
|
|
31119
|
-
// );
|
|
31120
|
-
// $rootFrame.append($skeleton_wrapper);
|
|
31121
|
-
// }
|
|
31122
|
-
|
|
31123
|
-
// const activate_skeleton = () => {
|
|
31124
|
-
// let $parent_div = $(
|
|
31125
|
-
// `[xu-ui-id="${$callingContainerP_data?.xuData?.parent_element_ui_id}"]`
|
|
31126
|
-
// );
|
|
31127
|
-
// if (!$parent_div?.length) return;
|
|
31128
|
-
|
|
31129
|
-
// var tags = ["SPAN", "INPUT", "BUTTON", "LI", "XU-PANEL"];
|
|
31130
|
-
// $.each($($parent_div).find("*"), (key, val) => {
|
|
31131
|
-
// if (tags.includes($(val).prop("tagName")) || !$(val).children().length) {
|
|
31132
|
-
// $(val).addClass("skeleton");
|
|
31133
|
-
// }
|
|
31134
|
-
// if ($(val).prop("tagName") === "XU-PANEL") {
|
|
31135
|
-
// $(val).addClass("skeleton-panel");
|
|
31136
|
-
// }
|
|
31137
|
-
// if ($(val).prop("tagName") === "IMG") {
|
|
31138
|
-
// let src = func.common.get_url(
|
|
31139
|
-
// SESSION_ID,
|
|
31140
|
-
// "dist",
|
|
31141
|
-
// "runtime/images/skeleton-img.png"
|
|
31142
|
-
// );
|
|
31143
|
-
// $(val).attr("src", src);
|
|
31144
|
-
// }
|
|
31145
|
-
// });
|
|
31146
|
-
// };
|
|
31147
|
-
// if (is_panelP) {
|
|
31148
|
-
// activate_skeleton();
|
|
31149
|
-
// }
|
|
31150
|
-
// console.log("***");
|
|
31151
31029
|
func.UI.utils.indicator.screen.busy();
|
|
31152
31030
|
|
|
31153
|
-
const ret = await func.datasource.create(
|
|
31154
|
-
SESSION_ID,
|
|
31155
|
-
prog_id,
|
|
31156
|
-
refreshed_ds, //params?.callingDataSource_objP?.dsSession
|
|
31157
|
-
params.parentDataSourceNoP,
|
|
31158
|
-
$rootFrame.attr('id'),
|
|
31159
|
-
rowIdP,
|
|
31160
|
-
jobNoP,
|
|
31161
|
-
null,
|
|
31162
|
-
parameters_raw_obj,
|
|
31163
|
-
null,
|
|
31164
|
-
null,
|
|
31165
|
-
null,
|
|
31166
|
-
null,
|
|
31167
|
-
null,
|
|
31168
|
-
parameters_obj_inP,
|
|
31169
|
-
);
|
|
31031
|
+
const ret = await func.datasource.create(SESSION_ID, prog_id, refreshed_ds, params.parentDataSourceNoP, $rootFrame.attr('id'), rowIdP, jobNoP, null, parameters_raw_obj, null, null, null, null, null, parameters_obj_inP);
|
|
31170
31032
|
|
|
31171
31033
|
var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[ret.dsSessionP];
|
|
31172
31034
|
_ds.screen_params = params;
|
|
31173
31035
|
|
|
31174
|
-
// _ds.is_panel = is_panelP;
|
|
31175
|
-
// setInterval(() => {
|
|
31176
|
-
// _ds.ts = Date.now();
|
|
31177
|
-
// }, 10000);
|
|
31178
|
-
|
|
31179
31036
|
params.dsSessionP = ret.dsSessionP;
|
|
31180
31037
|
|
|
31181
31038
|
func.UI.screen.update_SYS_OBJ_WIN_INFO(SESSION_ID, params.dsSessionP);
|
|
@@ -31657,23 +31514,8 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
|
|
|
31657
31514
|
if ($elm?.length) {
|
|
31658
31515
|
const elm_data = $elm.data();
|
|
31659
31516
|
const $wrapper = $elm.parent();
|
|
31660
|
-
// const wrapper_data = $wrapper.data();
|
|
31661
|
-
const refreshed_ds = _ds.dsSession;
|
|
31662
31517
|
|
|
31663
|
-
|
|
31664
|
-
// const ts = Date.now();
|
|
31665
|
-
// $.each($elm.find('xu-root-component-' + SESSION_ID).find('*'), function (key, val) {
|
|
31666
|
-
// let xu_ui_id = $(val).attr('xu-ui-id');
|
|
31667
|
-
// if (xu_ui_id) {
|
|
31668
|
-
// let new_id = xu_ui_id + ts;
|
|
31669
|
-
// elm_to_delete.push(new_id);
|
|
31670
|
-
|
|
31671
|
-
// $(val).attr('xu-ui-id', new_id).removeData();
|
|
31672
|
-
// }
|
|
31673
|
-
// // else {
|
|
31674
|
-
// // $(val).remove();
|
|
31675
|
-
// // }
|
|
31676
|
-
// });
|
|
31518
|
+
const refreshed_ds = _ds.dsSession;
|
|
31677
31519
|
|
|
31678
31520
|
$elm.empty();
|
|
31679
31521
|
if ($elm.data()) {
|
|
@@ -31692,11 +31534,6 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
|
|
|
31692
31534
|
elm_data.xuData.$root_container, // the wrapper root container
|
|
31693
31535
|
);
|
|
31694
31536
|
|
|
31695
|
-
// // remove old screen content
|
|
31696
|
-
// $.each(elm_to_delete, async function (key, val) {
|
|
31697
|
-
// $("[xu-ui-id='" + elm_to_delete + "']").remove();
|
|
31698
|
-
// });
|
|
31699
|
-
|
|
31700
31537
|
if (glb.DEBUG_MODE) {
|
|
31701
31538
|
console.info('========= refresh main info ==============');
|
|
31702
31539
|
console.info('reason:', refresh_reason);
|
|
@@ -31792,169 +31629,6 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
|
|
|
31792
31629
|
}
|
|
31793
31630
|
};
|
|
31794
31631
|
|
|
31795
|
-
// func.UI.screen.refresh_screen_old = async function (SESSION_ID, fields_changed_arr, datasource_changed, fields_changed_datasource) {
|
|
31796
|
-
// // check the main program
|
|
31797
|
-
// if (fields_changed_datasource) {
|
|
31798
|
-
// const _session = SESSION_OBJ[SESSION_ID];
|
|
31799
|
-
// const _ds = _session.DS_GLB[fields_changed_datasource];
|
|
31800
|
-
// const prog_doc = await func.utils.DOCS_OBJ.get(SESSION_ID, _ds.prog_id);
|
|
31801
|
-
// const progDataSource_str = JSON.stringify(prog_doc.progDataSource);
|
|
31802
|
-
// for (const field_id of fields_changed_arr || []) {
|
|
31803
|
-
// }
|
|
31804
|
-
// }
|
|
31805
|
-
|
|
31806
|
-
// const panels_obj = await func.UI.utils.get_panels_wrapper_from_dom(SESSION_ID, $(SESSION_OBJ[SESSION_ID].root_element), false);
|
|
31807
|
-
|
|
31808
|
-
// for await (const [parent_element_ui_id, panel_val] of Object.entries(panels_obj)) {
|
|
31809
|
-
// const progDataSource_str = JSON.stringify(panel_val.prog_doc.progDataSource);
|
|
31810
|
-
|
|
31811
|
-
// var found, refresh_reason, refresh_details;
|
|
31812
|
-
// if (fields_changed_arr) {
|
|
31813
|
-
// if (fields_changed_datasource && panel_val._ds.dsSession <= Number(fields_changed_datasource)) {
|
|
31814
|
-
// continue;
|
|
31815
|
-
// }
|
|
31816
|
-
// for (const field_id of fields_changed_arr) {
|
|
31817
|
-
// // get panel attributes
|
|
31818
|
-
// const _attributes = panel_val?.panelXuAttributes || {};
|
|
31819
|
-
|
|
31820
|
-
// // detect if program changed
|
|
31821
|
-
// found = _attributes['xu-exp:program']?.includes('@' + field_id);
|
|
31822
|
-
|
|
31823
|
-
// if (found) {
|
|
31824
|
-
// refresh_reason = `program ${_attributes['xu-exp:program']} ${field_id} changed `;
|
|
31825
|
-
// refresh_details = _attributes;
|
|
31826
|
-
// break;
|
|
31827
|
-
// }
|
|
31828
|
-
|
|
31829
|
-
// // _attributes holds also info of parameters in code_in: @code
|
|
31830
|
-
// // search field changed in panel call send parameters exp
|
|
31831
|
-
// for (const [attr, value] of Object.entries(_attributes)) {
|
|
31832
|
-
// const pattern = /xu-exp:(\w+)/;
|
|
31833
|
-
// const match = attr.match(pattern);
|
|
31834
|
-
|
|
31835
|
-
// if (!match) {
|
|
31836
|
-
// // continue if attribute is not expression
|
|
31837
|
-
// continue;
|
|
31838
|
-
// }
|
|
31839
|
-
// // code_in
|
|
31840
|
-
// const parameter_in_field_id = match?.[1];
|
|
31841
|
-
// // @code
|
|
31842
|
-
// if (value.includes(field_id)) {
|
|
31843
|
-
// // search parameter in field in the target program's progDataSource
|
|
31844
|
-
// found = progDataSource_str?.includes('@' + parameter_in_field_id);
|
|
31845
|
-
|
|
31846
|
-
// if (found) {
|
|
31847
|
-
// refresh_reason = `field ${field_id} in progDataSource parameter_in changed`;
|
|
31848
|
-
// refresh_details = panel_val?.prog_doc?.progDataSource;
|
|
31849
|
-
|
|
31850
|
-
// break;
|
|
31851
|
-
// }
|
|
31852
|
-
|
|
31853
|
-
// // found = find_field_in_progUi(prog_doc.progUi, parameter_in_field_id, 'xu-for');
|
|
31854
|
-
// found = func.UI.find_field_in_progUi_attributes(panel_val.prog_doc.progUi, parameter_in_field_id, 'xu-for').length;
|
|
31855
|
-
|
|
31856
|
-
// if (found) {
|
|
31857
|
-
// refresh_reason = `field ${field_id} in progUi xu-for parameter_in changed`;
|
|
31858
|
-
// refresh_details = found;
|
|
31859
|
-
|
|
31860
|
-
// break;
|
|
31861
|
-
// }
|
|
31862
|
-
// }
|
|
31863
|
-
// }
|
|
31864
|
-
|
|
31865
|
-
// if (found) break;
|
|
31866
|
-
|
|
31867
|
-
// // search field changed in the target program's progDataSource // @code
|
|
31868
|
-
// found = progDataSource_str?.includes('@' + field_id);
|
|
31869
|
-
// if (found) {
|
|
31870
|
-
// refresh_reason = `field ${field_id} in progDataSource changed`;
|
|
31871
|
-
// refresh_details = panel_val?.prog_doc?.progDataSource;
|
|
31872
|
-
|
|
31873
|
-
// break;
|
|
31874
|
-
// }
|
|
31875
|
-
|
|
31876
|
-
// found = func.UI.find_field_in_progUi_attributes(panel_val.prog_doc.progUi, field_id, 'xu-for').length;
|
|
31877
|
-
// if (found) {
|
|
31878
|
-
// refresh_reason = `field ${field_id} in progUi xu-for changed`;
|
|
31879
|
-
// refresh_details = found;
|
|
31880
|
-
|
|
31881
|
-
// break;
|
|
31882
|
-
// }
|
|
31883
|
-
|
|
31884
|
-
// if (found) {
|
|
31885
|
-
// break;
|
|
31886
|
-
// }
|
|
31887
|
-
// }
|
|
31888
|
-
// }
|
|
31889
|
-
|
|
31890
|
-
// if (datasource_changed) {
|
|
31891
|
-
// if (panel_val._ds.dsSession == datasource_changed) {
|
|
31892
|
-
// refresh_reason = `panel datasource ${datasource_changed} changed`;
|
|
31893
|
-
// refresh_details = '';
|
|
31894
|
-
|
|
31895
|
-
// found = true;
|
|
31896
|
-
// }
|
|
31897
|
-
// }
|
|
31898
|
-
// if (found) {
|
|
31899
|
-
// const _session = SESSION_OBJ[SESSION_ID];
|
|
31900
|
-
// if (_session.engine_mode === 'live_preview') {
|
|
31901
|
-
// console.info('========= refresh info ==============');
|
|
31902
|
-
// console.info('reason:', refresh_reason);
|
|
31903
|
-
// console.info('details:', refresh_details);
|
|
31904
|
-
// console.info('panel:', panel_val);
|
|
31905
|
-
// console.info('=====================================');
|
|
31906
|
-
// }
|
|
31907
|
-
// const $div_elm = panel_val.$panel_div;
|
|
31908
|
-
// const wrapper_data = $div_elm.data();
|
|
31909
|
-
|
|
31910
|
-
// if (_.isEmpty(wrapper_data)) continue;
|
|
31911
|
-
|
|
31912
|
-
// try {
|
|
31913
|
-
// const ts = Date.now();
|
|
31914
|
-
// // remove old panel content
|
|
31915
|
-
// $.each(panel_val.ids, async function (key, val) {
|
|
31916
|
-
// $("[xu-ui-id='" + val + "']")
|
|
31917
|
-
// .attr('xu-ui-id', val + ts)
|
|
31918
|
-
// .removeData();
|
|
31919
|
-
// });
|
|
31920
|
-
|
|
31921
|
-
// let refreshed_ds;
|
|
31922
|
-
// // check if ds exist and deleted by garbage collector
|
|
31923
|
-
|
|
31924
|
-
// if (_session.DS_GLB[panel_val._ds.dsSession]) {
|
|
31925
|
-
// refreshed_ds = panel_val._ds.dsSession;
|
|
31926
|
-
// }
|
|
31927
|
-
// for await (const item of wrapper_data.xuData.node_org.children) {
|
|
31928
|
-
// if (item.tagName !== 'xu-panel') continue;
|
|
31929
|
-
|
|
31930
|
-
// const new_$div = await func.UI.screen.render_ui_tree(
|
|
31931
|
-
// SESSION_ID,
|
|
31932
|
-
// $div_elm, // the wrapper
|
|
31933
|
-
// _.cloneDeep(item), // _.cloneDeep(wrapper_data.xuData.node_org.children[0]), // the xu-panel node
|
|
31934
|
-
// {},
|
|
31935
|
-
// wrapper_data.xuData.paramsP, // the wrapper params
|
|
31936
|
-
// null,
|
|
31937
|
-
// null,
|
|
31938
|
-
// wrapper_data.xuData.key, // the wrapper key
|
|
31939
|
-
// refreshed_ds, // the refreshed_ds
|
|
31940
|
-
// wrapper_data.xuData.parent_node, // the wrapper parent node
|
|
31941
|
-
// null,
|
|
31942
|
-
// wrapper_data.xuData.$root_container, // the wrapper root container
|
|
31943
|
-
// );
|
|
31944
|
-
// }
|
|
31945
|
-
|
|
31946
|
-
// // remove old panel content
|
|
31947
|
-
// $.each(panel_val.ids, async function (key, val) {
|
|
31948
|
-
// $("[xu-ui-id='" + val + ts + "']").remove();
|
|
31949
|
-
// });
|
|
31950
|
-
// } catch (error) {
|
|
31951
|
-
// debugger;
|
|
31952
|
-
// }
|
|
31953
|
-
// // continue;
|
|
31954
|
-
// }
|
|
31955
|
-
// }
|
|
31956
|
-
// };
|
|
31957
|
-
|
|
31958
31632
|
const get_params_obj_new = async function (SESSION_ID, prog_id, nodeP, dsSession) {
|
|
31959
31633
|
const _prog = await func.utils.VIEWS_OBJ.get(SESSION_ID, prog_id);
|
|
31960
31634
|
if (!_prog) return;
|
|
@@ -32222,7 +31896,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
32222
31896
|
let is_dynamic_field = false;
|
|
32223
31897
|
let field_prop;
|
|
32224
31898
|
let bind_field_id;
|
|
32225
|
-
|
|
31899
|
+
|
|
32226
31900
|
const input_field_type = $elm.attr('type');
|
|
32227
31901
|
|
|
32228
31902
|
const get_bind_field = async function (field_id) {
|
|
@@ -32233,11 +31907,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
32233
31907
|
field_prop = func.common.find_item_by_key(view_ret.progFields, 'field_id', field_id);
|
|
32234
31908
|
if (!field_prop) {
|
|
32235
31909
|
/// find the field everywhere in the chain Aug 30 2024
|
|
32236
|
-
const ret_get_value = await func.datasource.get_value(
|
|
32237
|
-
SESSION_ID,
|
|
32238
|
-
field_id,
|
|
32239
|
-
_dsP, // $elm.data().xuData.paramsP.dsSessionP
|
|
32240
|
-
);
|
|
31910
|
+
const ret_get_value = await func.datasource.get_value(SESSION_ID, field_id, _dsP);
|
|
32241
31911
|
|
|
32242
31912
|
if (ret_get_value.found) {
|
|
32243
31913
|
_dsP = ret_get_value.dsSessionP;
|
|
@@ -32255,38 +31925,12 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
32255
31925
|
return field_id;
|
|
32256
31926
|
};
|
|
32257
31927
|
|
|
32258
|
-
// try {
|
|
32259
|
-
// bind_field_id = await get_bind_field(val.value);
|
|
32260
|
-
// val_is_reference_field = true;
|
|
32261
|
-
// } catch (err) {
|
|
32262
|
-
// try {
|
|
32263
|
-
// if (!_.isEmpty($elm?.data()?.xuAttributes?.['xu-exp:xu-bind'])) {
|
|
32264
|
-
// bind_field_exp = $elm.data().xuAttributes['xu-exp:xu-bind'];
|
|
32265
|
-
// const res = await func.expression.get(SESSION_ID, bind_field_exp, paramsP.dsSessionP, 'UI Attr EXP');
|
|
32266
|
-
|
|
32267
|
-
// if (Object.keys(res.fields).length) {
|
|
32268
|
-
// const field_id_from_exp = Object.keys(res.fields)[0];
|
|
32269
|
-
// bind_field_id = await get_bind_field(field_id_from_exp);
|
|
32270
|
-
// } else {
|
|
32271
|
-
// throw err?.message || err;
|
|
32272
|
-
// }
|
|
32273
|
-
// } else {
|
|
32274
|
-
// throw err?.message || err;
|
|
32275
|
-
// }
|
|
32276
|
-
// } catch (err) {
|
|
32277
|
-
// console.error(err?.message || err);
|
|
32278
|
-
// return {};
|
|
32279
|
-
// }
|
|
32280
|
-
// // return {};
|
|
32281
|
-
// }
|
|
32282
|
-
|
|
32283
31928
|
try {
|
|
32284
31929
|
bind_field_id = await get_bind_field(val.value.split('.')[0]);
|
|
32285
31930
|
val_is_reference_field = true;
|
|
32286
31931
|
} catch (err) {
|
|
32287
31932
|
console.error(err?.message || err);
|
|
32288
31933
|
return {};
|
|
32289
|
-
// return {};
|
|
32290
31934
|
}
|
|
32291
31935
|
|
|
32292
31936
|
const field_changed = async function (e) {
|
|
@@ -32332,10 +31976,6 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
32332
31976
|
|
|
32333
31977
|
var value = await func.common.get_cast_val(SESSION_ID, 'xu-bind', 'value', field_prop.props.fieldType, bind.getter($elm[0]));
|
|
32334
31978
|
|
|
32335
|
-
// if (field_prop.props.fieldType === 'object' && !val_is_reference_field) {
|
|
32336
|
-
// value = bind.getter($elm[0]);
|
|
32337
|
-
// }
|
|
32338
|
-
|
|
32339
31979
|
if (field_prop.props.fieldType === 'object') {
|
|
32340
31980
|
value = await func.common.get_cast_val(SESSION_ID, 'xu-bind', 'value', input_field_type, bind.getter($elm[0]));
|
|
32341
31981
|
}
|
|
@@ -32357,14 +31997,13 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
32357
31997
|
if (reference_source_obj.ret.type === 'array') {
|
|
32358
31998
|
if (iterate_info.iterator_val === bind_field_id) {
|
|
32359
31999
|
const arr_idx = Number($elm?.data()?.xuData?.iterate_info._key);
|
|
32360
|
-
|
|
32000
|
+
|
|
32361
32001
|
const dataset_arr = await func.datasource.get_value(SESSION_ID, reference_source_obj.fieldIdP, _dsP, reference_source_obj.currentRecordId);
|
|
32362
32002
|
let new_arr = _.cloneDeep(dataset_arr.ret.value);
|
|
32363
|
-
|
|
32003
|
+
|
|
32364
32004
|
if (field_prop.props.fieldType === 'object' && val_is_reference_field) {
|
|
32365
32005
|
let obj_item = new_arr[arr_idx];
|
|
32366
|
-
|
|
32367
|
-
// let new_val = eval(e_exp + `="${value}"`);
|
|
32006
|
+
|
|
32368
32007
|
let e_exp = val.value.replace(bind_field_id, 'obj_item');
|
|
32369
32008
|
|
|
32370
32009
|
let new_val = eval(e_exp + (input_field_type === 'string' ? `="${value}"` : `=${value}`));
|
|
@@ -32382,7 +32021,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
32382
32021
|
},
|
|
32383
32022
|
},
|
|
32384
32023
|
};
|
|
32385
|
-
|
|
32024
|
+
|
|
32386
32025
|
await func.datasource.update(SESSION_ID, datasource_changes, null, true);
|
|
32387
32026
|
}
|
|
32388
32027
|
}
|
|
@@ -32436,7 +32075,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
32436
32075
|
$('body').on('xu-bind-refresh.' + _ds.dsSession.toString(), () => {
|
|
32437
32076
|
set_value();
|
|
32438
32077
|
});
|
|
32439
|
-
|
|
32078
|
+
|
|
32440
32079
|
set_value();
|
|
32441
32080
|
return {};
|
|
32442
32081
|
},
|
|
@@ -34487,10 +34126,6 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
34487
34126
|
function (entries) {
|
|
34488
34127
|
entries.forEach((entry) => {
|
|
34489
34128
|
if (entry.isIntersecting) {
|
|
34490
|
-
// Element is in viewport - trigger custom event
|
|
34491
|
-
// console.log('trigger>>', 'inViewport_' + $(entry.target).attr('xu-ui-id'));
|
|
34492
|
-
|
|
34493
|
-
// $(entry.target).trigger('inViewport_' + $(entry.target).attr('xu-ui-id'));
|
|
34494
34129
|
$(entry.target).trigger('inViewport');
|
|
34495
34130
|
|
|
34496
34131
|
// Optional: stop observing once triggered
|
|
@@ -34520,9 +34155,6 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
34520
34155
|
},
|
|
34521
34156
|
);
|
|
34522
34157
|
|
|
34523
|
-
// if ($div.parent().data().xuData.viewport_elm_height) {
|
|
34524
|
-
// $div.css(height, $div.parent().data().xuData.viewport_elm_height);
|
|
34525
|
-
// }
|
|
34526
34158
|
let ui_job_id;
|
|
34527
34159
|
$div.on('inViewport', function () {
|
|
34528
34160
|
if ($div.children().length) {
|
|
@@ -34530,13 +34162,8 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
34530
34162
|
return;
|
|
34531
34163
|
}
|
|
34532
34164
|
|
|
34533
|
-
// const height = $div.data().xuData.viewport_height;
|
|
34534
|
-
// if (typeof height !== 'undefined') {
|
|
34535
|
-
// $div.css('height', 'unset');
|
|
34536
|
-
$div[0].style.removeProperty('height');
|
|
34537
|
-
// }
|
|
34538
|
-
|
|
34539
34165
|
if (UI_WORKER_OBJ.cache[$div.attr('xu-ui-id')]) {
|
|
34166
|
+
$div[0].style.removeProperty('height');
|
|
34540
34167
|
$div.removeClass('skeleton');
|
|
34541
34168
|
$div.html(UI_WORKER_OBJ.cache[$div.attr('xu-ui-id')]);
|
|
34542
34169
|
} else {
|
|
@@ -34607,13 +34234,6 @@ func.UI.screen.refresh_document_changes_for_realtime_update = async function (SE
|
|
|
34607
34234
|
try {
|
|
34608
34235
|
// disabled in purpose to support create row
|
|
34609
34236
|
|
|
34610
|
-
// const row_idx = func.common.find_ROWID_idx(_ds, doc_change.row_id);
|
|
34611
|
-
|
|
34612
|
-
// console.log(
|
|
34613
|
-
// "refresh_document_changes_for_realtime_update",
|
|
34614
|
-
// _ds.data_feed.rows[row_idx]
|
|
34615
|
-
// );
|
|
34616
|
-
|
|
34617
34237
|
if (!_ds.screen_params) continue;
|
|
34618
34238
|
if (_ds.screen_params.is_panelP) {
|
|
34619
34239
|
func.UI.screen.refresh_screen(SESSION_ID, null, key);
|
|
@@ -34626,128 +34246,6 @@ func.UI.screen.refresh_document_changes_for_realtime_update = async function (SE
|
|
|
34626
34246
|
}
|
|
34627
34247
|
}
|
|
34628
34248
|
};
|
|
34629
|
-
|
|
34630
|
-
// func.UI.screen.hover_in = function (SESSION_ID, $div, $container, paramsP, is_skeleton) {
|
|
34631
|
-
// if (is_skeleton || EXP_BUSY) return;
|
|
34632
|
-
|
|
34633
|
-
// var _session = SESSION_OBJ[SESSION_ID];
|
|
34634
|
-
// var _ds = _session.DS_GLB[paramsP.dsSessionP];
|
|
34635
|
-
|
|
34636
|
-
// const _$ = function ($elm) {
|
|
34637
|
-
// try {
|
|
34638
|
-
// const id = $elm.attr('xu-ui-id');
|
|
34639
|
-
// if (!id) return $elm;
|
|
34640
|
-
// const $el = $(`[xu-ui-id="${id}"]`); // $("#" + id);
|
|
34641
|
-
|
|
34642
|
-
// if ($el.length > 1) {
|
|
34643
|
-
// console.warn('Multiple elements for xu-ui-id: ' + id, $el);
|
|
34644
|
-
// }
|
|
34645
|
-
|
|
34646
|
-
// return $($el[0]);
|
|
34647
|
-
// } catch (e) {
|
|
34648
|
-
// console.error(e);
|
|
34649
|
-
// }
|
|
34650
|
-
// };
|
|
34651
|
-
|
|
34652
|
-
// CLIENT_ACTIVITY_TS = Date.now();
|
|
34653
|
-
// if (_$($container)?.data()?.xuData?.debug_info) _$($container).data().xuData.debug_info.hover_item = $div.attr('xu-ui-id');
|
|
34654
|
-
// if (!_ds) return;
|
|
34655
|
-
// ///////// SET Attributes///////////
|
|
34656
|
-
// let attributes = {};
|
|
34657
|
-
// $.each($div[0].attributes, function (index, attr) {
|
|
34658
|
-
// attributes[attr.name] = attr.value;
|
|
34659
|
-
// });
|
|
34660
|
-
|
|
34661
|
-
// SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system.SYS_OBJ_WIN_ELEMENT_HOVERED_ATTRIBUTES = attributes;
|
|
34662
|
-
// //////////////////////////////////
|
|
34663
|
-
// if (!$div.data()?.xuData) return;
|
|
34664
|
-
// const _iterate_info = $div.data().xuData.iterate_info;
|
|
34665
|
-
// if (_iterate_info) {
|
|
34666
|
-
// if (_iterate_info.is_key_dynamic_field) {
|
|
34667
|
-
// _ds.dynamic_fields[_iterate_info.iterator_key].value = _iterate_info._key;
|
|
34668
|
-
// } else {
|
|
34669
|
-
// try {
|
|
34670
|
-
// const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
|
|
34671
|
-
// _ds.data_feed.rows[row_idx][_iterate_info.iterator_key] = _iterate_info._key;
|
|
34672
|
-
// } catch (err) {
|
|
34673
|
-
// console.error(err);
|
|
34674
|
-
// }
|
|
34675
|
-
// }
|
|
34676
|
-
|
|
34677
|
-
// if (_iterate_info.is_val_dynamic_field) {
|
|
34678
|
-
// _ds.dynamic_fields[_iterate_info.iterator_val].value = _iterate_info._val;
|
|
34679
|
-
// } else {
|
|
34680
|
-
// try {
|
|
34681
|
-
// const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
|
|
34682
|
-
// _ds.data_feed.rows[row_idx][_iterate_info.iterator_val] = _iterate_info._val;
|
|
34683
|
-
// } catch (err) {
|
|
34684
|
-
// console.error(err);
|
|
34685
|
-
// }
|
|
34686
|
-
// }
|
|
34687
|
-
// }
|
|
34688
|
-
|
|
34689
|
-
// if ($div && _$($div) && _ds && paramsP.renderType === 'grid') {
|
|
34690
|
-
// func.UI.worker.add_to_queue(SESSION_ID, 'gui event', 'update_datasource', { currentRecordId: _$($div).data().xuData.currentRecordId }, null, null, paramsP.dsSessionP);
|
|
34691
|
-
// }
|
|
34692
|
-
|
|
34693
|
-
// const set_value = function (field_id, value) {
|
|
34694
|
-
// var currentRecordId = _$($div).data().xuData.currentRecordId;
|
|
34695
|
-
|
|
34696
|
-
// func.UI.worker.add_to_queue(
|
|
34697
|
-
// SESSION_ID,
|
|
34698
|
-
// 'gui event',
|
|
34699
|
-
// 'update_datasource',
|
|
34700
|
-
// {
|
|
34701
|
-
// currentRecordId,
|
|
34702
|
-
// field_id,
|
|
34703
|
-
// field_value: value,
|
|
34704
|
-
// },
|
|
34705
|
-
// null,
|
|
34706
|
-
// null,
|
|
34707
|
-
// paramsP.dsSessionP,
|
|
34708
|
-
// );
|
|
34709
|
-
// };
|
|
34710
|
-
|
|
34711
|
-
// if ($div?.data()?.iterate_info) {
|
|
34712
|
-
// var data = $div.data().xuData.iterate_info;
|
|
34713
|
-
// if (data.iterator_key) {
|
|
34714
|
-
// set_value(data.iterator_key, data._key);
|
|
34715
|
-
// }
|
|
34716
|
-
// if (data.iterator_val) {
|
|
34717
|
-
// set_value(data.iterator_val, data._val);
|
|
34718
|
-
// }
|
|
34719
|
-
// }
|
|
34720
|
-
// };
|
|
34721
|
-
// func.UI.screen.hover_out = function (SESSION_ID, $container, is_skeleton, paramsP) {
|
|
34722
|
-
// if (is_skeleton || EXP_BUSY) return;
|
|
34723
|
-
|
|
34724
|
-
// var _session = SESSION_OBJ[SESSION_ID];
|
|
34725
|
-
// var _ds = _session.DS_GLB[paramsP.dsSessionP];
|
|
34726
|
-
|
|
34727
|
-
// const _$ = function ($elm) {
|
|
34728
|
-
// try {
|
|
34729
|
-
// const id = $elm.attr('xu-ui-id');
|
|
34730
|
-
// if (!id) return $elm;
|
|
34731
|
-
// const $el = $(`[xu-ui-id="${id}"]`); // $("#" + id);
|
|
34732
|
-
|
|
34733
|
-
// if ($el.length > 1) {
|
|
34734
|
-
// console.warn('Multiple elements for xu-ui-id: ' + id, $el);
|
|
34735
|
-
// }
|
|
34736
|
-
|
|
34737
|
-
// return $($el[0]);
|
|
34738
|
-
// } catch (e) {
|
|
34739
|
-
// console.error(e);
|
|
34740
|
-
// }
|
|
34741
|
-
// };
|
|
34742
|
-
|
|
34743
|
-
// CLIENT_ACTIVITY_TS = Date.now();
|
|
34744
|
-
// if (_$($container)?.data()?.xuData?.debug_info) {
|
|
34745
|
-
// _$($container).data().xuData.debug_info.hover_item = null;
|
|
34746
|
-
// }
|
|
34747
|
-
// if (_ds?.data_system) {
|
|
34748
|
-
// SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system.SYS_OBJ_WIN_ELEMENT_HOVERED_ATTRIBUTES = {};
|
|
34749
|
-
// }
|
|
34750
|
-
// };
|
|
34751
34249
|
func.UI.component = {};
|
|
34752
34250
|
|
|
34753
34251
|
func.UI.component.create_app_modal_component = function (
|
|
@@ -37192,10 +36690,9 @@ func.events.execute = async function (
|
|
|
37192
36690
|
return;
|
|
37193
36691
|
}
|
|
37194
36692
|
|
|
37195
|
-
// args.prog_id = _viewId;
|
|
37196
36693
|
if (_ds) {
|
|
37197
36694
|
func.utils.debug.watch(SESSION_ID, calling_trigger_prop?.id, functionP, null, calling_trigger_prop, expCond);
|
|
37198
|
-
|
|
36695
|
+
|
|
37199
36696
|
const ret = await func.datasource.create(SESSION_ID, await get_prog_id(), args.dataSourceNoP, args.parentDataSourceNoP, args.containerIdP, args.rowIdP, args.jobNoP, args.calling_trigger_prop, null, null, args.callingSourceP, args.calling_jobP, args.screen_dsP, args.is_panelP, params_obj);
|
|
37200
36697
|
|
|
37201
36698
|
let _ds_new = _session.DS_GLB[ret.dsSessionP];
|
|
@@ -37203,31 +36700,6 @@ func.events.execute = async function (
|
|
|
37203
36700
|
if (parameters && !_.isEmpty(parameters)) {
|
|
37204
36701
|
await func.datasource.update_changes_for_out_parameter(SESSION_ID, _ds_new.dsSession, _ds.dsSession);
|
|
37205
36702
|
}
|
|
37206
|
-
// if (parameters && !_.isEmpty(parameters) && _ds_new.PARAM_OUT_INFO) {
|
|
37207
|
-
// let data = {};
|
|
37208
|
-
// for await (const [key, val] of Object.entries(
|
|
37209
|
-
// _ds_new.PARAM_OUT_INFO
|
|
37210
|
-
// )) {
|
|
37211
|
-
// if (val.prop === "out") {
|
|
37212
|
-
// try {
|
|
37213
|
-
// const row_idx = func.common.find_ROWID_idx(
|
|
37214
|
-
// _ds_new,
|
|
37215
|
-
// _ds_new.currentRecordId
|
|
37216
|
-
// );
|
|
37217
|
-
// data[val.details] =
|
|
37218
|
-
// _ds_new.data_feed.rows[row_idx][val.fieldId];
|
|
37219
|
-
// } catch (err) {
|
|
37220
|
-
// console.error(err);
|
|
37221
|
-
// }
|
|
37222
|
-
// }
|
|
37223
|
-
// }
|
|
37224
|
-
// if (!_.isEmpty(data)) {
|
|
37225
|
-
// let datasource_changes = {
|
|
37226
|
-
// [_ds.dsSession]: { [_ds.currentRecordId]: data },
|
|
37227
|
-
// };
|
|
37228
|
-
// await func.datasource.update(SESSION_ID, datasource_changes);
|
|
37229
|
-
// }
|
|
37230
|
-
// }
|
|
37231
36703
|
|
|
37232
36704
|
func.events.delete_job(SESSION_ID, jobNoP);
|
|
37233
36705
|
return _ds_new;
|
|
@@ -37282,6 +36754,13 @@ func.events.execute = async function (
|
|
|
37282
36754
|
}
|
|
37283
36755
|
|
|
37284
36756
|
await func.datasource.update(SESSION_ID, datasource_changes);
|
|
36757
|
+
|
|
36758
|
+
if (_ds.PARAM_OUT_INFO) {
|
|
36759
|
+
for await (const [dsSession_to_update, val] of Object.entries(datasource_changes)) {
|
|
36760
|
+
await func.datasource.update_changes_for_out_parameter(SESSION_ID, _ds.dsSession, dsSession_to_update);
|
|
36761
|
+
}
|
|
36762
|
+
}
|
|
36763
|
+
|
|
37285
36764
|
if (jobNoP) func.events.delete_job(SESSION_ID, jobNoP);
|
|
37286
36765
|
// return changes;
|
|
37287
36766
|
},
|
|
@@ -39424,7 +38903,7 @@ func.index.init_document_listeners = function () {
|
|
|
39424
38903
|
set_idle(0);
|
|
39425
38904
|
}
|
|
39426
38905
|
|
|
39427
|
-
if (_session.engine_mode === 'live_preview' || !_session.opt.
|
|
38906
|
+
if (_session.engine_mode === 'live_preview' || !_session.opt.enable_user_assist) {
|
|
39428
38907
|
return;
|
|
39429
38908
|
}
|
|
39430
38909
|
|